/* Custom CSS for Print My Worksheets */

/* CSS Variables for Design System */
:root {
    --primary-color: #2563eb;
    --secondary-color: #f97316;
    --neutral-color: #6b7280;
    --spacing-base: 8px;
}

/* Typography Improvements */
.font-sans {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

.font-serif {
    font-family: 'Source Serif Pro', ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

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

/* Focus States for Accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Dropdown Menu Animations */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.group:hover .group-hover\:visible {
    visibility: visible;
}

/* Mobile Menu Transitions */
.mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

.mobile-menu.active {
    max-height: 1000px;
}

/* Worksheet Card Hover Effects */
.worksheet-card {
    transition: all 0.3s ease;
}

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

/* Hero Section Background */
.hero-bg {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    position: relative;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Button Component Styles */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-secondary:hover {
    background-color: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Grade Level Cards */
.grade-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.grade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Testimonial Cards */
.testimonial-card {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 3rem;
    font-weight: bold;
    color: var(--secondary-color);
    line-height: 1;
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

/* Responsive Image Containers */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-container img {
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        font-size: 12px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bg-gradient-to-br {
        background: white !important;
        border: 2px solid black;
    }
    
    .text-gray-600,
    .text-gray-700 {
        color: black !important;
    }
}

/* Focus Management */
.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;
}

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

.skip-nav:focus {
    top: 6px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Grid Layout Enhancements */
.worksheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .worksheet-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Footer Styles */
footer a:hover {
    color: var(--secondary-color) !important;
}

/* Custom Utilities */
.text-balance {
    text-wrap: balance;
}

.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container-custom {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-custom {
        padding: 0 2rem;
    }
}