:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-elevated: #252525;
    --color-primary: #ff6b00;
    --color-primary-hover: #ff8c3f;
    --color-secondary: #e0e0e0;
    --color-muted: #8a8a8a;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --post-bg: #1a1a1a;
    --font-main: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--color-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--color-secondary);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary);
}

button {
    cursor: pointer;
    font-family: var(--font-main);
}

/* ===== Layout principal ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Top Navigation ===== */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

.navbar-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.navbar-menu {
    display: flex;
    gap: 20px;
}

.navbar-menu-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.navbar-menu-btn:hover {
    color: var(--color-primary);
}

.navbar-search {
    position: relative;
    max-width: 400px;
    width: 40%;
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: none;
    background-color: var(--bg-elevated);
    color: var(--color-secondary);
    font-size: 0.9rem;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
}

/* ===== Main Content Area ===== */
.main-content {
    margin-top: 70px;
    margin-bottom: 80px;
    padding: 0 15px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.feed-filter {
    display: flex;
    overflow-x: auto;
    margin-bottom: 20px;
    padding: 10px 0;
    gap: 10px;
    scrollbar-width: none; /* For Firefox */
}

.feed-filter::-webkit-scrollbar {
    display: none; /* For Chrome, Safari and Opera */
}

.filter-btn {
    background: none;
    border: none;
    color: var(--color-muted);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background-color: var(--color-primary);
    color: #fff;
}

.filter-btn:hover:not(.active) {
    background-color: var(--bg-elevated);
    color: var(--color-secondary);
}

/* ===== Posts ===== */
.posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post {
    background-color: var(--post-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.post-badge {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 15px;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.post-header .profile-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
}

.post-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.post-time {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.post-content {
    margin-bottom: 20px;
}

.post-content h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--color-secondary);
}

.post-content p {
    margin-bottom: 15px;
    color: var(--color-secondary);
}

.post-img {
    width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag {
    color: var(--color-primary);
    font-size: 0.9rem;
    margin-right: 5px;
}

.post-stats {
    display: flex;
    margin: 15px 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    padding-bottom: 15px;
}

.stat {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.stat i {
    margin-right: 6px;
}

.participants {
    margin-left: auto;
    font-weight: 600;
}

.post-actions {
    display: flex;
    justify-content: space-between;
}

.action-btn {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    padding: 8px 0;
    flex: 1;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.action-btn:hover {
    background-color: var(--bg-elevated);
    color: var(--color-primary);
}

.action-btn i {
    margin-right: 6px;
}

.action-btn.liked {
    color: var(--color-primary);
}

/* ===== Event & Contest Specifics ===== */
.event-details,
.contest-details {
    background-color: var(--bg-elevated);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.event-detail,
.contest-detail {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.event-detail i,
.contest-detail i {
    width: 20px;
    color: var(--color-primary);
    margin-right: 10px;
}

.event-cta,
.contest-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.event-btn,
.contest-btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-grow: 1;
    text-align: center;
    min-width: 120px;
}

.event-btn.primary,
.contest-btn.primary {
    background-color: var(--color-primary);
    color: white;
    border: none;
}

.event-btn.primary:hover,
.contest-btn.primary:hover {
    background-color: var(--color-primary-hover);
}

.event-btn.secondary,
.contest-btn.secondary {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.event-btn.secondary:hover,
.contest-btn.secondary:hover {
    background-color: rgba(255, 107, 0, 0.1);
}

/* ===== Poll Styling ===== */
.poll-options {
    margin: 15px 0;
}

.poll-option {
    background-color: var(--bg-elevated);
    margin-bottom: 10px;
    border-radius: 20px;
    overflow: hidden;
    height: 40px;
    position: relative;
    cursor: pointer;
}

.poll-progress {
    background-color: rgba(255, 107, 0, 0.2);
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-radius: 20px;
    transition: width 0.5s ease;
}

.poll-option.selected .poll-progress {
    background-color: rgba(255, 107, 0, 0.4);
}

.poll-info {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 10px;
}

/* ===== Comments Section ===== */
.comments {
    margin-top: 20px;
    
    padding-top: 15px;
}

.add-comment {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.add-comment .profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

.comment-input {
    flex-grow: 1;
    border: none;
    background-color: var(--bg-elevated);
    color: var(--color-secondary);
    padding: 12px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.comment-input::placeholder {
    color: var(--color-muted);
}

.comment {
    display: flex;
    margin-bottom: 15px;
}

.comment .profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

.comment-content {
    flex-grow: 1;
    background-color: var(--bg-elevated);
    padding: 10px 15px;
    border-radius: 0 15px 15px 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.comment-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.comment-content p {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 0.8rem;
    margin-right: 12px;
    padding: 0;
    transition: color 0.2s;
}

.comment-actions button:hover {
    color: var(--color-primary);
}

/* ===== Bottom Creation Bar ===== */
.create-post-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 12px 15px;
    z-index: 90;
}

.create-post {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.post-input-container {
    flex-grow: 1;
    background-color: var(--bg-elevated);
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
}

.post-input {
    flex-grow: 1;
    border: none;
    background: none;
    color: var(--color-secondary);
    padding: 5px 0;
    font-size: 0.95rem;
    min-height: 24px;
    max-height: 100px;
    resize: none;
    overflow-y: auto;
}

.post-input:focus {
    outline: none;
}

.post-input::placeholder {
    color: var(--color-muted);
}

.post-actions {
    display: flex;
    gap: 15px;
    margin-left: 10px;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 0;
}

.post-action-btn:hover {
    color: var(--color-primary);
}

.post-btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 6px 15px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    margin-left: 5px;
}

.post-btn:hover {
    background-color: var(--color-primary-hover);
}

.post-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* ===== Side Navigation ===== */
.side-nav {
    position: fixed;
    width: 60px;
    height: calc(100vh - 60px - 60px); /* Navbar height and create bar height */
    top: 60px;
    left: 0;
    background-color: var(--bg-secondary);
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    transition: width 0.3s ease;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}

.side-nav:hover {
    width: 200px;
}

.nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    color: var(--color-secondary);
    margin-bottom: 5px;
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--bg-elevated);
    color: var(--color-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background-color: var(--color-primary);
}

.nav-item i {
    font-size: 1.25rem;
    width: 20px;
    text-align: center;
}

.nav-item span {
    margin-left: 15px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.side-nav:hover .nav-item span {
    opacity: 1;
}

/* ===== Loading Indicator ===== */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: var(--color-primary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 107, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}



@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 768px) {
    .side-nav {
        bottom: 60px;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }

    .side-nav:hover {
        width: 100%;
    }

    .nav-item {
        flex-direction: column;
        padding: 8px 0;
        margin: 0;
        justify-content: center;
        flex: 1;
    }

    .nav-item.active::before {
        width: 100%;
        height: 3px;
        top: 0;
        left: 0;
    }

    .nav-item i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .nav-item span {
        margin-left: 0;
        font-size: 0.75rem;
        opacity: 1;
    }

    .main-content {
        margin-bottom: 130px;
    }
}

/* Hide side navigation on very small screens */
@media (max-width: 480px) {
    .nav-item span {
        display: none;
    }

    .post-actions .action-btn span {
        display: none;
    }

    .post-actions .action-btn i {
        margin-right: 0;
        font-size: 1.2rem;
    }

    .event-cta, .contest-cta {
        flex-direction: column;
    }
}

/* Contest code input */
.contest-code {
    background-color: var(--bg-elevated);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}



.code-input-container {
    display: flex;
    margin-top: 10px;
}

.code-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    background-color: var(--bg-primary);
    color: var(--color-secondary);
}

.validate-code-btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    padding: 0 15px;
    font-weight: 600;
}

.validate-code-btn:hover {
    background-color: var(--color-primary-hover);
}


/* No content message */
.no-content-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-muted);
    background-color: var(--post-bg);
    border-radius: 10px;
    margin-top: 20px;
}

/* Styles pour le bouton de suppression des commentaires */
.delete-comment-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.delete-comment-btn:hover {
    opacity: 1;
}

/* Ajustement de l'en-tête du commentaire pour accueillir le bouton de suppression */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.comment-header h4 {
    margin-right: 8px;
}

.no-content-message i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--color-primary);
}

.no-content-message h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}