* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

h1 {
    font-size: 32px;
    font-weight: 600;
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.post-text {
    text-align: center;
    word-wrap: break-word;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.4;
}

.post-timestamp {
    text-align: center;
    display: block;
    font-size: 14px;
    color: #999;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

@media (max-width: 600px) {
    .container {
        padding: 20px 16px;
    }
    
    .post {
        padding: 24px;
    }
    
    header {
        margin-bottom: 40px;
    }
}

.post-text a {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 123, 255, 0.3);
    transition: all 0.2s;
}

.post-text a:hover {
    border-bottom-color: #007bff;
}

.post-text strong {
    font-weight: 600;
}

.post-text em {
    font-style: italic;
}

.post-text .post-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ========== MODE SOMBRE ========== */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .post {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.dark-mode .post-text {
    color: #cccccc;
}

body.dark-mode .post-text a {
    color: #66b3ff;
}

body.dark-mode .post-timestamp {
    color: #888;
}

/* Bouton toggle dark mode */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    z-index: 1000;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
}

body.dark-mode .dark-mode-toggle {
    background: #f0f0f0;
    color: #333;
}

/* Permaliens */
.permalink {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    font-size: 0.85em;
    text-decoration: none;
    transition: all 0.2s ease;
    opacity: 0.6;
    color: inherit;
}

.permalink:hover {
    opacity: 1 !important;
    background: #033818;
    transform: scale(1.1);
}

/* Animation highlight */
@keyframes highlight {
    0%, 100% { background: transparent; }
    50% { background: rgba(255, 235, 59, 0.2); }
}

/* Small screens: reposition dark mode toggle at bottom center and make it static */
@media (max-width: 600px) {
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    .container {
        flex: 1 0 auto;
    }
    .dark-mode-toggle {
        position: static;
        top: auto;
        right: auto;
        left: auto;
        bottom: auto;
        align-self: center;
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin: 12px 0 16px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.15);
    }
}
