/**
 * SCL Academy Support Portal - Main Styles
 * Modern, clean design for the knowledge base
 */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    
    /* Neutrals */
    --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;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Spacing */
    --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;
    
    /* Borders & Shadows */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Layout
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.main {
    flex: 1;
    padding: var(--space-8) 0;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: var(--font-size-xl);
    color: var(--gray-900);
}

.logo:hover {
    color: var(--primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: var(--space-6);
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    padding: var(--space-2) 0;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-search {
    flex: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    background: var(--gray-50);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
}

/* ============================================
   Flash Messages
   ============================================ */
.flash-message {
    padding: var(--space-3) 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.flash-message .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--space-16) 0;
    text-align: center;
    margin: calc(-1 * var(--space-8)) 0 var(--space-8) 0;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
}

.hero-search input {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-size-lg);
    box-shadow: var(--shadow-lg);
}

.hero-search input:focus {
    outline: none;
    box-shadow: var(--shadow-xl), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
}

.section-link {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ============================================
   Category Cards
   ============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-12);
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.category-content h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.category-content p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* ============================================
   Guide Cards
   ============================================ */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
}

.guide-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.guide-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: var(--gray-200);
}

.guide-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guide-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.guide-card:hover .guide-play-icon {
    opacity: 1;
}

.guide-body {
    padding: var(--space-5);
}

.guide-category {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.guide-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
    line-height: 1.4;
}

.guide-excerpt {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-4);
}

.guide-meta {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
}

/* ============================================
   Single Guide Page
   ============================================ */
.guide-single {
    max-width: 900px;
    margin: 0 auto;
}

.guide-header {
    margin-bottom: var(--space-8);
}

.guide-breadcrumb {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-4);
}

.guide-breadcrumb a {
    color: var(--gray-500);
}

.guide-breadcrumb a:hover {
    color: var(--primary);
}

.guide-single .guide-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-4);
}

.video-wrapper {
    position: relative;
    padding-top: 56.25%;
    background: var(--gray-900);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-8);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.guide-content {
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.guide-content h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin: var(--space-6) 0 var(--space-3);
}

.guide-content h2:first-child {
    margin-top: 0;
}

.guide-content p {
    margin-bottom: var(--space-4);
}

.guide-content ul, .guide-content ol {
    margin: var(--space-4) 0;
    padding-left: var(--space-6);
}

.guide-content li {
    margin-bottom: var(--space-2);
}

.guide-content code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: var(--space-5);
    background: none;
    border: none;
    text-align: left;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-fast);
}

.faq-question:hover {
    background: var(--gray-50);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--gray-400);
    transition: transform var(--transition-fast);
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding: 0 var(--space-5) var(--space-5);
    color: var(--gray-600);
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    display: block;
}

/* ============================================
   Ticket Form
   ============================================ */
.ticket-form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

.btn-full {
    width: 100%;
}

/* ============================================
   Search Results
   ============================================ */
.search-results-header {
    margin-bottom: var(--space-6);
}

.search-results-header h1 {
    font-size: var(--font-size-2xl);
    color: var(--gray-900);
}

.search-results-header p {
    color: var(--gray-500);
}

.no-results {
    text-align: center;
    padding: var(--space-12) 0;
    color: var(--gray-500);
}

.no-results h2 {
    font-size: var(--font-size-xl);
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: var(--space-8) 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: white;
}

.footer-links {
    display: flex;
    gap: var(--space-6);
}

.footer-links a {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
}

.footer-links a:hover {
    color: white;
}

.footer-copy {
    font-size: var(--font-size-sm);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .nav-links,
    .nav-search {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .categories-grid,
    .guides-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

.hidden { display: none; }
