/* ===========================
   பல்கலை - Global Styles
   =========================== */

:root {
    /* Color Palette - Tamil Heritage Inspired */
    --primary-color: #ff6b35;
    --primary-dark: #e05028;
    --secondary-color: #004e89;
    --secondary-dark: #003661;
    --accent-color: #ffa630;
    --success-color: #06a77d;
    --warning-color: #f77f00;
    --danger-color: #d62828;
    
    /* Neutral Colors */
    --dark: #1a1a2e;
    --text-dark: #2d2d2d;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    
    /* Typography */
    --font-primary: 'Noto Sans Tamil', 'Arial', sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-primary);
    line-height: var(--line-height-base);
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===========================
   Typography
   =========================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ===========================
   Navigation
   =========================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    padding: var(--spacing-sm) 0;
}

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

.nav-brand {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition-fast);
    border-radius: 3px;
}

/* ===========================
   Hero Section
   =========================== */

.hero {
    margin-top: 80px;
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--bg-white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="white" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--bg-white);
    margin-bottom: var(--spacing-sm);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-sm);
}

.hero-description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-md);
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.hero-illustration {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    position: relative;
}

.floating-card {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.floating-card.delay-1 {
    animation-delay: 0.5s;
}

.floating-card.delay-2 {
    animation-delay: 1s;
    grid-column: span 2;
}

.floating-card .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.floating-card p {
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}

/* ===========================
   Buttons
   =========================== */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--bg-white);
    border-color: var(--bg-white);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===========================
   Section Styling
   =========================== */

section {
    padding: var(--spacing-xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

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

/* ===========================
   Subjects Section
   =========================== */

.subjects {
    background: var(--bg-light);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.subject-card {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.subject-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.subject-card h3 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.subject-card > p {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.topic-list {
    list-style: none;
    margin: var(--spacing-sm) 0;
    padding: 0;
}

.topic-list li {
    padding: var(--spacing-xs) 0;
    color: var(--text-light);
    position: relative;
    padding-left: 1.5rem;
}

.topic-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.subject-card .btn {
    width: 100%;
    margin-top: var(--spacing-sm);
}

/* ===========================
   Features Section
   =========================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.feature-item {
    text-align: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
}

.feature-item h3 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===========================
   Demo Section
   =========================== */

.demo-section {
    background: var(--bg-light);
}

.demo-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.demo-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-light);
}

.demo-tab {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.demo-tab:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-color);
}

.demo-tab.active {
    background: var(--bg-white);
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.demo-content {
    padding: var(--spacing-md);
}

.demo-panel {
    display: none;
}

.demo-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.demo-panel h3 {
    margin-bottom: var(--spacing-md);
    text-align: center;
}

/* Math Demo */
.multiplication-table {
    max-width: 500px;
    margin: 0 auto;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
}

.table-controls label {
    font-weight: 600;
}

.table-controls input {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    width: 80px;
}

.table-result {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    line-height: 2;
}

/* Science Quiz */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-question {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.quiz-option {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.quiz-option:hover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.1);
}

.quiz-option.correct {
    border-color: var(--success-color);
    background: rgba(6, 167, 125, 0.1);
}

.quiz-option.incorrect {
    border-color: var(--danger-color);
    background: rgba(214, 40, 40, 0.1);
}

.quiz-feedback {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
}

.quiz-feedback.correct {
    color: var(--success-color);
    background: rgba(6, 167, 125, 0.1);
}

.quiz-feedback.incorrect {
    color: var(--danger-color);
    background: rgba(214, 40, 40, 0.1);
}

/* Tamil Practice */
.tamil-practice {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.letter-display {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.tamil-letter {
    font-size: 8rem;
    color: var(--bg-white);
    font-weight: 700;
    display: block;
}

.letter-controls {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.letter-info {
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* ===========================
   About Section
   =========================== */

.about {
    background: var(--bg-white);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.about-text h2 {
    margin-bottom: var(--spacing-md);
}

.about-text h3 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: var(--spacing-sm);
    text-align: justify;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--bg-white);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ===========================
   Footer
   =========================== */

.footer {
    background: var(--dark);
    color: var(--bg-white);
    padding: var(--spacing-xl) 0 var(--spacing-sm);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.footer-section h3,
.footer-section h4 {
    color: var(--bg-white);
    margin-bottom: var(--spacing-sm);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.social-links a {
    font-size: 1.5rem;
    transition: transform var(--transition-fast);
}

.social-links a:hover {
    transform: scale(1.2);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: var(--spacing-sm);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* ===========================
   Animations
   =========================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 968px) {
    .hero .container {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-lg);
        padding: var(--spacing-md) 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-sm);
        width: 100%;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-tabs {
        flex-direction: column;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .floating-card {
        padding: var(--spacing-sm);
    }
    
    .floating-card .icon {
        font-size: 2rem;
    }
    
    .tamil-letter {
        font-size: 5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ===========================
   Utility Classes
   =========================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.hidden {
    display: none;
}

.visible {
    display: block;
}
