/* Print My Worksheets - Custom CSS Styles */
/* Design System Implementation for Educational Platform */

:root {
    /* Color System - Max 3 colors as specified */
    --primary-coral: #FF6B6B;
    --secondary-teal: #4ECDC4;
    --neutral-dark: #2C3E50;
    
    /* Spacing System - 8pt Grid */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-2xl: 64px;
    
    /* Typography System */
    --font-primary: 'Jost', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    
    /* Container Sizing */
    --container-max: 1200px;
    
    /* Breakpoints */
    --breakpoint-sm: 375px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1200px;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--neutral-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

/* Utility Classes */
.bg-primary { background-color: var(--primary-coral); }
.bg-secondary { background-color: var(--secondary-teal); }
.bg-neutral { background-color: var(--neutral-dark); }
.text-primary { color: var(--primary-coral); }
.text-secondary { color: var(--secondary-teal); }
.text-neutral { color: var(--neutral-dark); }
.border-primary { border-color: var(--primary-coral); }
.border-secondary { border-color: var(--secondary-teal); }

/* Hero Section Gradient */
.hero-bg {
    background: linear-gradient(135deg, var(--primary-coral) 0%, var(--secondary-teal) 100%);
}

/* Component Specific Styles */

/* Header Component */
header {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navigation Hover Effects */
nav a:hover,
.dropdown button:hover {
    color: var(--primary-coral);
    transition: color 0.2s ease-in-out;
}

/* Worksheet Card Component */
.worksheet-card {
    transition: all 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
}

.worksheet-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.worksheet-card img {
    transition: transform 0.3s ease-in-out;
}

.worksheet-card:hover img {
    transform: scale(1.02);
}

/* Subject Card Component */
.subject-card {
    transition: all 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
}

.subject-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
}

/* Grade Card Component */
.grade-card {
    transition: all 0.3s ease-in-out;
    font-weight: 600;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grade-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2);
}

/* Testimonial Card Component */
.testimonial-card {
    border-left: 4px solid var(--primary-coral);
    transition: all 0.3s ease-in-out;
}

.testimonial-card:hover {
    border-left-color: var(--secondary-teal);
    transform: translateX(4px);
}

/* Value Card Component (About Page) */
.value-card {
    transition: all 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
}

.value-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
    border-color: var(--primary-coral);
}

/* Offering Card Component (About Page) */
.offering-card {
    transition: all 0.3s ease-in-out;
}

.offering-card:hover {
    transform: translateY(-4px);
}

/* Button Components */
.btn-primary {
    background-color: var(--primary-coral);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #ff5252;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-coral);
    padding: 12px 24px;
    border: 2px solid var(--primary-coral);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--primary-coral);
    color: white;
    transform: translateY(-1px);
}

/* Form Components */
input[type="email"],
input[type="text"],
textarea {
    border: 2px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    transition: border-color 0.2s ease-in-out;
    min-height: 44px;
}

input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-coral);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Newsletter Form */
.newsletter-form {
    max-width: 400px;
}

/* Grid System with 8pt spacing */
.grid-8pt {
    gap: var(--spacing-xs);
}

@media (min-width: 768px) {
    .grid-8pt {
        gap: var(--spacing-sm);
    }
}

@media (min-width: 1024px) {
    .grid-8pt {
        gap: var(--spacing-md);
    }
}

/* Mobile-First Responsive Design */

/* Mobile Styles (375px+) */
@media (min-width: 375px) {
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

/* Tablet Styles (768px+) */
@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    /* 2-column layouts */
    .grid-mobile-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mobile menu hidden on tablet+ */
    .mobile-menu {
        display: none;
    }
}

/* Desktop Styles (1024px+) */
@media (min-width: 1024px) {
    .container {
        max-width: var(--container-max);
        margin: 0 auto;
        padding: 0 var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    /* 3-column layouts */
    .grid-desktop-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop Styles (1200px+) */
@media (min-width: 1200px) {
    /* 4-column worksheet grids */
    .grid-xl-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Larger spacing for bigger screens */
    .grid-8pt {
        gap: var(--spacing-lg);
    }
}

/* Accessibility Enhancements */

/* Focus States */
.focus-visible:focus {
    outline: 2px solid var(--primary-coral);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-coral: #d32f2f;
        --secondary-teal: #00796b;
        --neutral-dark: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-friendly {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only.focus:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Skip Navigation Link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-coral);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-nav:focus {
    top: 0;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-coral);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error States */
.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.error-message {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    margin-top: var(--spacing-xs);
}

/* Success States */
.success {
    border-color: #059669;
    background-color: #f0fdf4;
}

.success-message {
    color: #059669;
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    margin-top: var(--spacing-xs);
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4/3;
    object-fit: cover;
}

.aspect-ratio-16-9 {
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Footer Styles */
footer {
    background-color: var(--neutral-dark);
    color: white;
}

footer a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

footer a:hover {
    color: white;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-coral);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff5252;
}