/**
 * ========================================================================
 * INDUSLEARN - PLATEFORME ÉDUCATIVE PROFESSIONNELLE
 * Styles optimisés pour un site web éducatif moderne
 * ========================================================================
 */

/* ==================== VARIABLES ==================== */
:root {
    /* Couleurs Principales */
    --white: #FFFFFF;
    --black: #000000;
    --orange: #FF8C00;
    --yellow: #FFD700;
    --violet: #8B00FF;
    --primary-orange: var(--orange);
    --primary-yellow: var(--yellow);
    --primary-violet: var(--violet);
    --primary-black: var(--black);
    --primary-white: var(--white);
    --gradient-primary: linear-gradient(135deg, #FF8C00 0%, #FFD700 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
    --gradient-violet: linear-gradient(135deg, #6d28d9 0%, #a855f7 100%);
    
    /* Couleurs Neutres */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --medium-gray: #6B7280;
    --border-gray: #E5E7EB;
    --light-gray: #F3F4F6;
    
    /* Typographie */
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Inter', 'Segoe UI', sans-serif;
    
    /* Espacements */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ==================== RESET ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--space-4);
    color: var(--gray-600);
}

a {
    color: var(--orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--yellow);
}

/* ==================== LAYOUT ==================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

/* ==================== HEADER ==================== */
.header {
    background: var(--white);
    border-bottom: 3px solid var(--orange);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-top {
    padding: var(--space-5) 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo {
    height: 70px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-left {
    flex-shrink: 0;
}

.site-branding {
    text-align: center;
}

.logo-right-absolute {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    height: 70px;
    width: auto;
    object-fit: contain;
    z-index: 10;
}

.header-content {
    position: relative;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--black);
    margin: 0;
    letter-spacing: -0.5px;
}

.site-tagline {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
    font-weight: 500;
}

.auth-links {
    display: flex;
    gap: var(--space-3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--orange);
    color: var(--white);
}

.btn-primary:hover {
    background: #E67E00;
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-800);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-700);
    color: var(--white);
}

/* ==================== NAVIGATION ==================== */
.navbar {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-2);
    overflow-x: auto;
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.938rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--orange);
    background: var(--gray-50);
}

.nav-link.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
    background: var(--gray-50);
}

.nav-icon {
    font-size: 1.125rem;
}

/* ==================== HERO SECTION ==================== */
.hero {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.hero-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    transition: opacity 0.5s ease;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 48rem;
    padding: var(--space-6);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--white);
    margin-bottom: var(--space-6);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--gray-300);
    margin-bottom: var(--space-8);
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-10);
    background: var(--orange);
    color: var(--white);
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
}

.hero-button:hover {
    background: var(--yellow);
    color: var(--gray-900);
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ==================== SEARCH SECTION ==================== */
.search-section {
    padding: var(--space-12) 0;
    background: var(--white);
}

.search-bar {
    max-width: 48rem;
    margin: 0 auto;
    display: flex;
    gap: var(--space-4);
    background: var(--white);
    padding: var(--space-3);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.search-input {
    flex: 1;
    padding: var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--orange);
}

.search-button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    background: var(--orange);
    color: var(--white);
    font-weight: 700;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-button:hover {
    background: #E67E00;
    transform: translateX(2px);
}

/* ==================== SECTIONS GRID ==================== */
#sections {
    padding: var(--space-16) 0;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
}

.section-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--orange);
}

.section-card.cours::before {
    background: var(--orange);
}

.section-card.examens::before {
    background: var(--yellow);
}

.section-card.td::before {
    background: var(--violet);
}

.section-card.ouvrages::before {
    background: var(--black);
}

.section-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.section-icon {
    font-size: 4rem;
    margin-bottom: var(--space-6);
}

.section-card.cours .section-icon {
    color: var(--orange);
}

.section-card.examens .section-icon {
    color: var(--yellow);
}

.section-card.td .section-icon {
    color: var(--violet);
}

.section-card.ouvrages .section-icon {
    color: var(--black);
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--gray-900);
}

.section-description {
    color: var(--gray-600);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.section-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-weight: 700;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    color: var(--white);
}

.section-card.cours .section-button {
    background: var(--orange);
}

.section-card.examens .section-button {
    background: var(--yellow);
    color: var(--gray-900);
}

.section-card.td .section-button {
    background: var(--violet);
}

.section-card.ouvrages .section-button {
    background: var(--black);
}

.section-button:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

/* ==================== ADS & UTILITY CARDS ==================== */
.ad-container {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow);
    text-align: center;
}

/* ==================== ABOUT SECTION ==================== */
.about-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-10);
    align-items: center;
    padding: var(--space-16) 0;
}

.about-image-wrapper {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-content {
    padding: var(--space-6);
}

.about-content h2 {
    font-size: 2rem;
    margin-bottom: var(--space-4);
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray-600);
}

/* ==================== TEAM SECTION ==================== */
.team-section {
    padding: var(--space-16) 0;
}

.team-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.team-image-container {
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.team-image {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.team-image-container:hover .team-image {
    transform: scale(1.02);
}

.team-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1.5rem 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.team-image-container:hover .team-image-overlay {
    opacity: 1;
}

.team-image-overlay span {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    text-align: center;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: var(--white);
    padding: var(--space-12) 0;
    margin-bottom: var(--space-10);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: var(--space-4);
}

.breadcrumb {
    display: flex;
    gap: var(--space-3);
    font-size: 0.938rem;
}

.breadcrumb-item a {
    color: var(--gray-300);
}

.breadcrumb-item a:hover {
    color: var(--white);
}

.breadcrumb-note {
    color: var(--gray-200);
    margin-top: var(--space-2);
    font-size: 0.95rem;
}

/* ==================== CONTENT PAGE ==================== */
.content-page {
    padding: var(--space-10) 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-10);
}

.sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-6);
    color: var(--gray-900);
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: var(--space-2);
}

.category-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--gray-700);
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.category-link:hover {
    background: var(--gray-100);
    color: var(--orange);
}

.category-link.active {
    background: var(--orange);
    color: var(--white);
}

/* ==================== FILES GRID ==================== */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-6);
}

.main-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.file-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.file-icon {
    font-size: 3rem;
    color: var(--orange);
    margin-bottom: var(--space-4);
}

.file-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--gray-900);
}

.file-meta {
    display: flex;
    gap: var(--space-4);
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: var(--space-4);
}

.file-actions {
    display: flex;
    gap: var(--space-3);
}

.file-btn {
    flex: 1;
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view {
    background: var(--gray-900);
    color: var(--white);
}

.btn-download {
    background: var(--orange);
    color: var(--white);
}

.file-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: var(--space-16);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

.footer-section h3 {
    color: var(--white);
    font-size: 1.125rem;
    margin-bottom: var(--space-4);
}

.footer-section p {
    color: var(--gray-400);
    line-height: 1.8;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.footer-section a {
    color: var(--gray-400);
    display: block;
    margin-bottom: var(--space-2);
}

.footer-section a:hover {
    color: var(--orange);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    border-top: 1px solid var(--gray-800);
    color: var(--gray-500);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-link {
        justify-content: center;
        width: 100%;
    }
    
    .hero {
        height: 400px;
    }
    
    .sections-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== UTILITIES ==================== */
.mt-3 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-6); }
.text-center { text-align: center; }

.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
}

/* ==================== MODAL VIEWER ==================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: var(--space-4);
    z-index: 1000;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--gray-600);
    cursor: pointer;
}

.pdf-viewer {
    width: 100%;
    height: 80vh;
    border: none;
}
