/* ===========================================
   Styles principaux - Vocabulaire
   Couleurs alignées sur syntaxe/conjugaison
   =========================================== */

/* Variables CSS (thème Sauge harmonisé) */
:root {
    --primary: #AADBC8;
    --primary-dark: #7BC4A8;
    --primary-light: #c5e8d8;
    --secondary: #E8F0EC;
    --background: #F5F5F0;
    --text: #4A635D;
    --text-light: #6B8A82;
    --white: #FFFFFF;
    --border: #d4e0da;
    --error: #E57373;
    --error-bg: #FFEBEE;
    --success: #81C784;
    --success-bg: #E8F5E9;
    --shadow: rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-small: 8px;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--text);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.header-nav a {
    text-decoration: none;
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-small);
    transition: all 0.2s;
}

.header-nav a:hover {
    background: var(--primary);
    color: var(--white);
}

.header-nav a.active {
    background: var(--primary-dark);
    color: var(--white);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu span {
    color: var(--text);
    font-weight: 500;
}

.user-menu a,
.user-menu button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    text-decoration: none;
}

.login-buttons {
    display: flex;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
}

.login-buttons .btn {
    pointer-events: auto;
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    user-select: none;
    position: relative;
    z-index: 1;
    gap: 0.25rem;
}

a.btn:hover {
    text-decoration: none;
}

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

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

.btn-google {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-google:hover {
    background: var(--secondary);
}

.btn-secondary {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--secondary);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: #d97706;
    color: white;
}

.btn-warning:hover {
    background: #b45309;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Welcome section */
.welcome-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.welcome-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px var(--shadow);
    max-width: 500px;
    text-align: center;
}

.welcome-card h2 {
    color: var(--text);
    margin-bottom: 1rem;
}

.features-list {
    list-style: none;
    text-align: left;
    margin: 1.5rem 0;
}

.features-list li {
    padding: 0.5rem 0;
    color: var(--text);
}

.cta {
    color: var(--primary-dark);
    font-weight: 600;
    margin-top: 1rem;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.welcome-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

@media (min-width: 400px) {
    .welcome-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Dashboard */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Variantes de cartes */
.card-presentation {
    border-top: 4px solid var(--text-light);
}

.card-words {
    border-top: 4px solid #f57c00;
}

.card-series {
    border-top: 4px solid var(--primary);
}

.card-imagier {
    border-top: 4px solid #42a5f5;
}

.card-flashcard {
    border-top: 4px solid #ab47bc;
}

.card-champ-lexical {
    border-top: 4px solid #ff6b9d;
}

.card-games {
    border-top: 4px solid #81C784;
}

.card-corpus {
    border-top: 4px solid #ff7043;
}

.card-guide {
    border-top: 4px solid #78909c;
}

.card-results {
    border-top: 4px solid #5c6bc0;
}

.card-admin {
    border-top: 4px solid var(--primary-dark);
}

.card-ressources {
    border-top: 4px solid #fdd835;
}

.card-library {
    border-top: 4px solid #26a69a;
}

/* Footer */
.footer {
    background: var(--white);
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-light);
}

.footer a {
    color: var(--primary-dark);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Messages */
.message {
    padding: 12px 15px;
    border-radius: var(--radius-small);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.message.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error);
}

.message.success {
    background: var(--success-bg);
    color: #2E7D32;
    border: 1px solid var(--success);
}

.message.hidden {
    display: none;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-right {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .login-buttons {
        justify-content: center;
        width: 100%;
    }

    .login-buttons .btn {
        min-height: 44px;
        min-width: 120px;
        padding: 0.75rem 1.5rem;
    }

    .user-menu {
        justify-content: center;
        width: 100%;
    }

    .user-menu a,
    .user-menu button {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .welcome-card {
        padding: 2rem;
    }

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

/* ===========================================
   Navigation principale (nav.js)
   =========================================== */

/* Navigation desktop */
.nav-desktop {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-small);
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--text);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

/* Navigation mobile */
.nav-mobile {
    display: none;
}

.nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

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

.nav-hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}

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

.nav-mobile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    box-shadow: 0 4px 12px var(--shadow);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 1000;
}

.nav-mobile-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    border-radius: var(--radius-small);
    transition: background 0.2s;
}

.nav-mobile-link:hover {
    background: var(--primary-light);
}

.nav-mobile-link.active {
    background: var(--primary);
    color: var(--white);
}

/* Responsive - Basculer vers menu mobile */
@media (max-width: 900px) {
    .nav-desktop {
        display: none;
    }

    .nav-mobile {
        display: block;
        position: relative;
    }

    .nav-label {
        display: inline;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }
}

/* ========================================
   Boutons modération admin
   Bloc séparé en bas des cartes partagées
   ======================================== */

.admin-moderation {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 2px dashed #fca5a5;
}

.btn-mod {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    font-size: 1.2rem;
    min-height: 38px;
    transition: all 0.15s;
    flex: 0 0 auto;
    position: relative;
}

.btn-mod:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.btn-mod::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #333;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.btn-mod:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

@media (max-width: 768px) {
    .btn-mod {
        min-width: 36px;
        min-height: 36px;
        padding: 0.4rem;
    }
}
