/* Shared CSS for Public Pages (Login, Commands, Leaderboard, Help) */
:root {
    --bg-dark: #0a0a12;
    --bg-card: #13131f;
    --primary: #6366f1;
    --accent: #fbbf24;
    --success: #22c55e;
    --text-main: #e8e8f0;
    --text-muted: #6b7280;
    --border-color: #1f1f2e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.4) 1px, transparent 0),
        radial-gradient(1px 1px at 30% 70%, rgba(255, 255, 255, 0.3) 1px, transparent 0),
        radial-gradient(1px 1px at 50% 30%, rgba(255, 255, 255, 0.4) 1px, transparent 0),
        radial-gradient(1px 1px at 70% 80%, rgba(255, 255, 255, 0.3) 1px, transparent 0),
        radial-gradient(1px 1px at 90% 40%, rgba(255, 255, 255, 0.4) 1px, transparent 0),
        radial-gradient(2px 2px at 25% 55%, rgba(255, 255, 255, 0.2) 1px, transparent 0),
        radial-gradient(circle at 80% 90%, rgba(99, 102, 241, 0.08), transparent 40%),
        radial-gradient(circle at 20% 10%, rgba(251, 191, 36, 0.05), transparent 40%);
}

/* === TOP NAVBAR === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 60px;
    /* Compact padding */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 18, 0.8);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.navbar-brand i {
    font-size: 1.3rem;
    color: var(--primary);
}

.navbar-links {
    display: flex;
    gap: 32px;
}

.navbar-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.navbar-links a:hover {
    color: var(--text-main);
}

.navbar-links a.active {
    color: var(--primary);
    font-weight: 500;
}

/* === HERO SECTION (Login) === */
.hero {
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px 20px;
    /* Reduced vertical padding */
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.offline {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.online::before {
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.offline::before {
    background: var(--text-muted);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.hero h1 {
    font-size: 3rem;
    /* Smaller Font */
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #5865F2;
    color: white;
    text-decoration: none;
    padding: 14px 36px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(88, 101, 242, 0.4);
}

.btn-discord i {
    font-size: 1.1rem;
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 15px 40px;
    /* Reduced vertical padding */
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: rgba(10, 10, 18, 0.5);
}

/* === GENERIC PAGE CONTENT (For Commands/Leaderboard/Help) === */
.page-container {
    flex: 1;
    /* Take remaining space */
    padding: 100px 40px 60px;
    /* Top padding for navbar */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
}

.page-title span {
    color: var(--primary);
}

.page-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Tables (for Leaderboard) */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.rank-badge {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.rank-1 .rank-badge {
    background: linear-gradient(135deg, #FFD700, #FDB931);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rank-2 .rank-badge {
    background: linear-gradient(135deg, #E0E0E0, #BDBDBD);
    color: #000;
}

.rank-3 .rank-badge {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    color: #000;
}

/* Commands List */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.command-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.command-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.command-name {
    font-family: 'Consolas', monospace;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.command-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        background: rgba(10, 10, 18, 0.95);
    }

    .navbar-links {
        width: 100%;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }

    .hero {
        padding: 120px 20px 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .page-container {
        padding: 140px 20px 40px;
    }

    /* Make tables responsive (Compact List View) */
    .page-title {
        font-size: 1.8rem;
    }

    .leaderboard-table,
    .leaderboard-table tbody {
        display: block;
        width: 100%;
    }

    .leaderboard-table thead {
        display: none;
    }

    .leaderboard-table tr {
        display: grid;
        grid-template-columns: 40px 1fr auto;
        grid-template-rows: auto auto;
        padding: 15px 20px;
        /* Increased horizontal padding */
        border-bottom: 1px solid var(--border-color);
        align-items: center;
        gap: 0 15px;
    }

    .leaderboard-table td {
        padding: 0;
        border: none;
        display: block;
    }

    .leaderboard-table td::before {
        display: none;
    }

    /* Rank: Left, centered */
    td[data-label="Rang"] {
        grid-column: 1;
        grid-row: 1 / 3;
        text-align: center;
        font-weight: bold;
        font-size: 1.1rem;
    }

    /* Member: Top Row, Middle */
    td[data-label="Membre"] {
        grid-column: 2;
        grid-row: 1;
        margin-bottom: 2px;
    }

    /* Stardust: Right, centered */
    td[data-label="Stardust"] {
        grid-column: 3;
        grid-row: 1 / 3;
        text-align: right;
        font-weight: bold;
        color: var(--accent);
        font-size: 1rem;
    }

    /* Level & XP: Bottom Row, Middle (Flex needed to inline?) */
    /* Hack: Put Level in Col 2 Row 2, XP hidden or absolute? */
    /* Let's make Level take the space and hide XP if needed, or append. */

    td[data-label="Niveau"] {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    td[data-label="XP Total"] {
        display: none;
        /* Hide XP to keep it compact as requested "trop gros" */
    }

    /* Improved Quest List Design */
    #quests-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .quest-item {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        padding: 16px;
        display: flex;
        gap: 16px;
        align-items: center;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .quest-item:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(99, 102, 241, 0.3);
        transform: translateX(5px);
    }

    .quest-item.completed {
        background: rgba(34, 197, 94, 0.05);
        border-color: rgba(34, 197, 94, 0.2);
    }

    .quest-icon {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: rgba(99, 102, 241, 0.1);
        color: #818cf8;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .quest-item.completed .quest-icon {
        background: rgba(34, 197, 94, 0.1);
        color: #4ade80;
    }

    .quest-content {
        flex: 1;
        min-width: 0;
        /* Text truncation fix */
    }

    .quest-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 4px;
    }

    .quest-header h4 {
        margin: 0;
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .quest-reward {
        font-size: 0.8rem;
        color: #ffd700;
        font-weight: 600;
        background: rgba(255, 215, 0, 0.1);
        padding: 2px 8px;
        border-radius: 6px;
        border: 1px solid rgba(255, 215, 0, 0.2);
    }

    .quest-content p {
        margin: 0 0 10px 0;
        font-size: 0.85rem;
        color: var(--text-muted);
        line-height: 1.3;
    }

    .quest-progress {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .progress-bar {
        flex: 1;
        height: 6px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
    }

    .progress {
        height: 100%;
        background: linear-gradient(90deg, #6366f1, #a855f7);
        border-radius: 3px;
        transition: width 0.5s ease;
    }

    .quest-item.completed .progress {
        background: #22c55e;
    }

    .progress-text {
        font-size: 0.75rem;
        color: var(--text-muted);
        min-width: 40px;
        text-align: right;
        font-family: monospace;
    }

    /* Adjust User Cell */
    .user-cell {
        gap: 10px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    /* Command Grid Mobile */
    .commands-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .platform-tabs {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 15px;
        justify-content: center;
    }

    .platform-btn {
        padding: 15px 20px;
        flex: 0 1 auto !important;
        /* Don't expand */
        width: auto !important;
        max-width: none !important;
    }

    .platform-btn span {
        display: none !important;
    }

    .platform-btn i {
        font-size: 1.8rem;
        margin: 0;
    }

    .search-container {
        width: 100%;
        max-width: 100%;
    }

    .support-contact {
        padding: 20px;
    }
}

/* === COMMANDS PAGE STYLES === */
.platform-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.platform-btn {
    flex: 1;
    max-width: 300px;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 12px 30px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.platform-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.search-container {
    max-width: 500px;
    margin: 0 auto 40px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 45px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.command-group {
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-out;
}

.group-title {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Optimized for mobile */
    gap: 20px;
}

.command-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s;
}

.command-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-tag {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 700;
}

.tag-eco {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.tag-fun {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

.tag-util {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.tag-mod {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.command-usage {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 6px;
}

.command-usage code {
    color: var(--primary);
    font-family: 'Consolas', monospace;
}

/* === AIDE/FAQ STYLES === */
.faq-section {
    max-width: 800px;
    margin: 0 auto 60px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.faq-question {
    padding: 24px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    color: var(--text-muted);
    line-height: 1.7;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    padding-bottom: 24px;
    max-height: 500px;
}

.faq-answer ul {
    margin: 10px 0 10px 20px;
}

.support-contact {
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.support-contact h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.support-contact p {
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: var(--text-muted);
}