/* ============================================================
   BrainSwag - Main Stylesheet
   Education, Research, AI Learning & Student Community
   ============================================================ */

/* --- Variables --- */
:root {
    /* Primary Colors */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --primary-bg: #EFF6FF;
    
    /* App Colors */
    --student: #2563EB;
    --tutor: #8B6914;
    --admin: #D4A017;
    
    /* Neutrals */
    --white: #FFFFFF;
    --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;
    
    /* Semantic */
    --success: #059669;
    --warning: #D97706;
    --error: #DC2626;
    --info: #0284C7;
    
    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --container: 1200px;
    
    /* Transitions */
    --transition: 0.3s ease;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- Container --- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 0.938rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-align: center;
    justify-content: center;
}

.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 16px 32px; font-size: 1.063rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary-bg);
    transform: translateY(-1px);
}

.btn-white {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}
.btn-white:hover {
    background: var(--gray-50);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,255,255,0.3);
}

.btn-outline-white {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}
.btn-outline-white:hover {
    background: rgba(255,255,255,0.1);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
}

.nav-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
}

.logo-text {
    color: var(--gray-900);
}
.logo-highlight {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 0.938rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: color var(--transition);
    position: relative;
}

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 72px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #E0E7FF 100%);
    z-index: -1;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding-top: 40px;
    padding-bottom: 80px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--gray-500);
    margin-bottom: 32px;
    max-width: 540px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Hero Phone Mockup */
.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-phone {
    perspective: 1000px;
}

.phone-frame {
    width: 280px;
    height: 560px;
    background: var(--gray-900);
    border-radius: 36px;
    padding: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--white);
    border-radius: 30px;
    overflow: hidden;
}

.phone-content {
    padding: 20px;
}

.app-header {
    text-align: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
    margin-bottom: 24px;
}

.app-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-card {
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.app-card.blue { background: var(--student); }
.app-card.gold { background: var(--admin); }
.app-card.brown { background: var(--tutor); }

/* --- Features Section --- */
.features {
    padding: 100px 0;
    background: var(--gray-50);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    transition: all var(--transition);
    border: 1px solid var(--gray-200);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    border-color: var(--primary-bg);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
}

.feature-icon.blue { background: var(--student); }
.feature-icon.gold { background: var(--admin); }
.feature-icon.green { background: var(--success); }
.feature-icon.brown { background: var(--tutor); }
.feature-icon.purple { background: #7C3AED; }
.feature-icon.red { background: var(--error); }

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.feature-card p {
    font-size: 0.938rem;
    color: var(--gray-500);
    line-height: 1.7;
}

/* --- Apps Download Section --- */
.apps-download {
    padding: 100px 0;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.app-card-download {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

.app-card-download:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.app-card-download.student-app:hover { border-color: var(--student); }
.app-card-download.tutor-app:hover { border-color: var(--tutor); }
.app-card-download.admin-app:hover { border-color: var(--admin); }

.app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.app-card-download h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.app-card-download p {
    color: var(--gray-500);
    margin-bottom: 20px;
    font-size: 0.938rem;
}

.app-version-info {
    margin-bottom: 20px;
}

.version-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.813rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* --- Testimonials --- */
.testimonials {
    padding: 100px 0;
    background: var(--gray-50);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.testimonial-card {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--gray-200);
}

.testimonial-stars {
    margin-bottom: 16px;
    font-size: 1.25rem;
}

.testimonial-card p {
    color: var(--gray-600);
    font-size: 0.938rem;
    line-height: 1.7;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.testimonial-author strong {
    display: block;
    font-size: 0.938rem;
    color: var(--gray-900);
}

.testimonial-author span {
    font-size: 0.813rem;
    color: var(--gray-500);
}

/* --- CTA Section --- */
.cta-section {
    padding: 100px 0;
}

.cta-card {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    border-radius: 24px;
    padding: 64px;
    text-align: center;
    color: white;
}

.cta-card h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.cta-card p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* --- Page Header --- */
.page-header {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--gray-500);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Download Page --- */
.download-section {
    padding: 60px 0 100px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.download-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

.download-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.download-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.download-card-header {
    padding: 32px;
    text-align: center;
    color: white;
}

.download-card-header.student { background: var(--student); }
.download-card-header.tutor { background: var(--tutor); }
.download-card-header.admin { background: var(--admin); }

.download-icon {
    margin-bottom: 16px;
}

.download-card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.version-label {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 0.813rem;
}

.download-card-body {
    padding: 24px 32px 32px;
}

.feature-list {
    margin-bottom: 20px;
}

.feature-list li {
    padding: 8px 0;
    font-size: 0.938rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}

.feature-list li:last-child {
    border-bottom: none;
}

.app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.app-meta span {
    font-size: 0.813rem;
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 4px 10px;
    border-radius: 6px;
}

.whats-new {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.whats-new h4 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.whats-new p {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* --- Footer --- */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 60px 0 30px;
}

.footer-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo-icon {
    margin-bottom: 16px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 8px;
}

.footer-brand p {
    font-size: 0.938rem;
    line-height: 1.7;
}

.footer-tagline {
    color: var(--gray-400);
    margin-top: 4px;
}

.footer-links h4 {
    font-size: 0.938rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--gray-400);
    transition: color var(--transition);
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--gray-800);
    font-size: 0.875rem;
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    color: var(--gray-400);
    transition: color var(--transition);
}

.footer-social a:hover {
    color: var(--white);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-subtitle { margin: 0 auto 32px; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-visual { display: none; }
    
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .apps-grid { grid-template-columns: repeat(2, 1fr); }
    .testimonials-grid { grid-template-columns: 1fr; }
    .download-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links, .nav-actions { display: none; }
    .nav-toggle { display: flex; }
    
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 24px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .nav-links.active + .nav-actions {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 320px;
        left: 0;
        right: 0;
        padding: 0 24px 24px;
        background: var(--white);
    }
    
    .hero-title { font-size: 2.5rem; }
    .hero-stats { gap: 24px; }
    
    .features-grid { grid-template-columns: 1fr; }
    .apps-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .cta-card { padding: 40px 24px; }
    .cta-actions { flex-direction: column; }
    .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .hero-actions { flex-direction: column; }
    .section-header h2 { font-size: 1.75rem; }
}
