/* Écran d'accueil moderne avec sidebar */
.home-screen {
    display: flex;
    height: calc(100vh - 40px);
    gap: 0;
    max-width: 100%;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
}

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

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-role {
    font-size: 12px;
    color: var(--accent-warning);
    font-weight: 500;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    width: 100%;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    font-size: 15px;
    text-align: left;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--accent-primary);
    transition: height 0.3s;
    border-radius: 0 4px 4px 0;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.nav-item.active::before {
    height: 70%;
}

.nav-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.nav-label {
    flex: 1;
    font-weight: 500;
}

.nav-badge {
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Footer sidebar */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-logout-sidebar {
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--accent-danger);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
}

.btn-logout-sidebar:hover {
    background: var(--accent-danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Contenu principal */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    padding: 40px;
}

.content-section {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

/* Cards */
.game-settings-card,
.players-card,
.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.game-settings-card h2,
.players-card h2,
.admin-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.setting-item label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.select-modern {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.select-modern:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-modern input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Player Form Modern */
.player-form-modern {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    margin-bottom: 24px;
}

.input-modern {
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s;
}

.input-modern:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-avatar-modern {
    padding: 14px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.btn-avatar-modern:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.avatar-preview-modern {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.btn-add-modern {
    padding: 14px 32px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
}

.btn-add-modern:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-add-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Players Grid */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.player-card-modern {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.player-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.player-avatar-modern {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 2px solid var(--border-color);
}

.player-name-modern {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.btn-remove-modern {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--accent-danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
}

.player-card-modern:hover .btn-remove-modern {
    opacity: 1;
}

.btn-remove-modern:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Start Button Modern */
.btn-start-modern {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent-success), #059669);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-start-modern:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.btn-start-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Saved Games Grid */
.saved-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.saved-game-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.saved-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.saved-game-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.saved-game-date-modern {
    font-size: 13px;
    color: var(--text-secondary);
}

.saved-game-status-modern {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.saved-game-status-modern.playing {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.saved-game-status-modern.finished {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.saved-game-info-modern {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
}

.saved-game-players-modern {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.saved-game-scores {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.scores-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 12px;
    text-align: center;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.score-item:last-child {
    margin-bottom: 0;
}

.score-item:hover {
    background: var(--bg-primary);
}

.score-rank {
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 24px;
}

.score-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.score-happiness {
    color: var(--accent-warning);
    font-weight: 700;
    font-size: 15px;
}

.score-points {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 13px;
    opacity: 0.8;
}

.score-status {
    font-size: 16px;
}

.saved-game-actions {
    display: flex;
    gap: 10px;
}

.btn-load-modern {
    flex: 1;
    padding: 10px 20px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-load-modern:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-delete-modern {
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.btn-delete-modern:hover {
    background: var(--accent-danger);
    transform: scale(1.1);
}

/* Bouton supprimer seul (quand pas de bouton "Reprendre") */
.saved-game-actions:has(.btn-delete-modern:only-child) .btn-delete-modern {
    flex: 1;
    font-size: 14px;
    color: var(--accent-danger);
}

.saved-game-actions:has(.btn-delete-modern:only-child) .btn-delete-modern:hover {
    color: white;
}

/* Admin Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-info {
    color: var(--text-primary);
}

.admin-info p {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.admin-info strong {
    color: var(--accent-primary);
    margin-right: 8px;
}

/* Error Modern */
.error-modern {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--accent-danger);
    font-size: 14px;
}

/* Menu Hamburger */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.hamburger-btn:hover {
    background: var(--accent-primary);
}

.hamburger-btn span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn:hover span {
    background: white;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Overlay pour mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .home-screen {
        flex-direction: row;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        padding: 80px 15px 20px 15px;
    }

    .section-title {
        font-size: 24px;
    }

    .player-form-modern {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .players-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .saved-games-grid {
        grid-template-columns: 1fr;
    }
}
