/* Learncraft - Design System Premium */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Palette de couleurs inspirée du logo */
    --primary: #00d4ff;       /* Cyan vibrant */
    --primary-dark: #008eb4;
    --secondary: #0891b2;
    --accent: #f59e0b;        /* Or pour le premium */
    --bg-dark: #0a0e27;       /* Bleu nuit profond */
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Base img responsiveness */
img {
    max-width: 100%;
    height: auto;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, .font-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

/* Container & Spacing Helpers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-p { padding: 80px 0; }
.card-p { padding: 40px; }

@media (max-width: 768px) {
    .section-p { padding: 40px 0; }
    .card-p { padding: 25px; }
    .container { padding: 0 15px; }
}

/* Typography Responsive */
h1 { font-size: clamp(28px, 8vw, 56px); }
h2 { font-size: clamp(24px, 6vw, 42px); }
h3 { font-size: clamp(20px, 5vw, 32px); }
p { font-size: clamp(14px, 4vw, 16px); }

@media (max-width: 600px) {
    .container { padding: 0 15px; }
    section { margin-bottom: 40px !important; }
}

/* Responsive Grid Helper */
.res-grid {
    display: grid;
    gap: 30px;
}
@media (max-width: 900px) {
    .res-grid { grid-template-columns: 1fr !important; }
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 10px 0;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(15px);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

@media (max-width: 600px) {
    .logo-img { height: 32px; }
    h1 { font-size: 24px !important; }
}

.nav-links {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

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

/* Mobile Bottom Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 10px 0;
    z-index: 1000;
}

@media (max-width: 900px) {
    .nav-links { display: none; }
    #mobile-toggle { display: block !important; }
    .mobile-nav { display: block; }
    body { padding-bottom: 70px; }
}

.mobile-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    gap: 4px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 160px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.2;
    z-index: -1;
}

.hero h1 {
    font-size: clamp(32px, 8vw, 64px);
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero p {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 40px;
}

.text-gradient {
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
}

.btn-outline:hover {
    background: var(--bg-card);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.subject-card {
    padding: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
}

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

.subject-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

/* Forms */
.auth-container {
    max-width: 450px;
    margin: 120px auto 40px;
    padding: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 12px 15px;
    border-radius: 10px;
    color: white;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes bounceIn {
    0% { transform: scale(0.1); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

.bounce-in { animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

/* Nouvelles Boîtes de Contenu (Histoire, Philo, Français) */
.box-date {
    background: linear-gradient(90deg, rgba(245,158,11,0.15) 0%, rgba(245,158,11,0.02) 100%);
    border-left: 4px solid var(--accent);
    padding: 15px 20px;
    margin: 25px 0;
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    border-radius: 0 10px 10px 0;
}

.box-argument {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 25px;
    margin: 30px 0;
    border-radius: 12px;
    position: relative;
}

.box-argument::before {
    content: '📌 ARGUMENT CLÉ';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--primary);
    color: var(--bg-dark);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.box-auteur {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 25px 25px 25px 50px;
    margin: 30px 0;
    border-radius: 12px;
    position: relative;
    font-style: italic;
    color: #e2e8f0;
}

.box-auteur::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 60px;
    color: var(--success);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.box-auteur strong {
    display: block;
    margin-top: 10px;
    font-style: normal;
    color: var(--success);
    font-size: 14px;
    text-transform: uppercase;
}

/* Confetti System */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    z-index: 1000;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Responsive fixes */
@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .auth-container { padding: 30px 20px; }
}

/* Mobile Optimizations (Phones) */
@media (max-width: 600px) {
    :root {
        --mobile-padding: 15px;
    }

    .container {
        padding: 0 var(--mobile-padding);
    }

    h1 { font-size: 28px !important; }
    h2 { font-size: 22px !important; }
    h3 { font-size: 18px !important; }

    .glass {
        padding: 20px !important;
        border-radius: 16px;
    }

    .box-argument, .box-auteur {
        padding: 20px !important;
        margin: 20px 0 !important;
        border-radius: 12px;
        font-size: 14px;
    }

    .box-auteur {
        padding-left: 40px !important;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero p {
        font-size: 15px;
        padding: 0 10px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Tabs adjustments */
    [style*="display: flex; gap: 5px;"] {
        gap: 8px !important;
        justify-content: center;
    }

    [style*="padding: 10px 15px;"] {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    /* Methodology adjustments */
    .method-card {
        padding: 15px !important;
        gap: 15px !important;
    }

    .method-number {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }

    .method-body h3 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }

    .method-body p, .method-body li {
        font-size: 13px !important;
    }

    .example-box {
        padding: 20px !important;
    }

    .example-box h3 {
        font-size: 18px !important;
    }

    .example-content {
        font-size: 13px !important;
    }

    /* Cards adjustments */
    .subjects-grid, .card-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }

    .glass.card-hover, .subject-card {
        padding: 15px !important;
        border-radius: 12px;
    }

    .glass.card-hover h3, .subject-card h3 {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 2.6em; 
    }

    .subject-card p {
        font-size: 11px !important;
        min-height: unset !important;
        line-height: 1.2 !important;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 10px !important;
    }

    .subject-icon {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }

    .glass.card-hover span {
        font-size: 8px !important;
    }

    .glass.card-hover .btn {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    [style*="padding-top: 20px; border-top: 1px solid var(--glass-border)"] {
        padding-top: 10px !important;
        font-size: 11px !important;
    }
}

/* Mobile fixes for methodology sections */
@media (max-width: 768px) {
    .method-section > div, 
    .method-section .glass, 
    .method-section div[style*='padding'] {
        padding: 12px !important;
        box-sizing: border-box !important;
    }
    .method-section div[style*='display: flex'] {
        flex-wrap: wrap !important;
    }
    .method-section h3, .method-section h4, .method-section h5 {
        font-size: 16px !important;
    }
    .method-section p, .method-section li {
        font-size: 13px !important;
    }
    .method-section table {
        display: block;
        overflow-x: auto;
    }
}

/* Mobile fixes for Conseils Pro section */
@media (max-width: 768px) {
    .conseils-section {
        padding: 15px !important;
    }
    .conseils-section > div, 
    .conseils-section .glass, 
    .conseils-section div[style*='padding'] {
        padding: 12px !important;
        box-sizing: border-box !important;
    }
    .conseils-section div[style*='display: flex'] {
        flex-wrap: wrap !important;
    }
    .conseils-section h3, .conseils-section h4, .conseils-section h5 {
        font-size: 18px !important;
    }
    .conseils-section p, .conseils-section li {
        font-size: 14px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    .conseils-section table {
        display: block;
        overflow-x: auto;
    }
}
