/* ===== SUBJECTS SECTION ===== */
.subjects {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
}

.subjects h2 {
    text-align: center;
    color: #1a365d;
    font-size: 2.8rem;
    margin-bottom: 3rem;
    font-weight: 700;
    line-height: 1.2;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.subject-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4299e1, #38b2ac, #4299e1);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.subject-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(66, 153, 225, 0.15);
    border-color: #e2e8f0;
}

.subject-card h3 {
    color: #2d3748;
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
    padding-bottom: 0.75rem;
}

.subject-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4299e1, #38b2ac);
    border-radius: 2px;
}

.subject-card p {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.subject-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.subject-links a {
    display: inline-block;
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
    color: #2c5282;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex: 1;
    min-width: 140px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.subject-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.subject-links a:hover {
    background: linear-gradient(135deg, #4299e1 0%, #38b2ac 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.3);
    border-color: #3182ce;
}

.subject-links a:hover::before {
    left: 100%;
}

.subject-links a:active {
    transform: translateY(0);
}

/* Grade-specific color accents */
.subject-card:nth-child(1) h3::after { background: linear-gradient(90deg, #ff6b6b, #ffa8a8); } /* Pre-K */
.subject-card:nth-child(2) h3::after { background: linear-gradient(90deg, #4ecdc4, #88d3ce); } /* K */
.subject-card:nth-child(3) h3::after { background: linear-gradient(90deg, #ffd166, #ffe9a8); } /* 1st */
.subject-card:nth-child(4) h3::after { background: linear-gradient(90deg, #06d6a0, #54e2b6); } /* 2nd */
.subject-card:nth-child(5) h3::after { background: linear-gradient(90deg, #118ab2, #4db5d3); } /* 3rd */
.subject-card:nth-child(6) h3::after { background: linear-gradient(90deg, #ef476f, #f584a0); } /* 4th */
.subject-card:nth-child(7) h3::after { background: linear-gradient(90deg, #7209b7, #9d4edd); } /* 5th */
.subject-card:nth-child(8) h3::after { background: linear-gradient(90deg, #f3722c, #f8965c); } /* Adult */

/* Optional: Add subtle icons for each grade */
.subject-card::after {
    content: '📚';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.subject-card:hover::after {
    opacity: 0.2;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .subjects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 1024px) {
    .subjects {
        padding: 3rem 1.5rem;
    }
    
    .subjects h2 {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .subjects-grid {
        padding: 0.5rem;
    }
}

@media (max-width: 768px) {
    .subjects {
        padding: 2.5rem 1rem;
    }
    
    .subjects h2 {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        gap: 1.75rem;
    }
    
    .subject-card {
        padding: 2rem 1.5rem;
    }
    
    .subject-card h3 {
        font-size: 1.6rem;
    }
    
    .subject-card p {
        font-size: 1.05rem;
    }
    
    .subject-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .subject-links a {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .subjects {
        padding: 2rem 0.75rem;
    }
    
    .subjects h2 {
        font-size: 1.9rem;
        padding: 0 0.5rem;
    }
    
    .subject-card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }
    
    .subject-card h3 {
        font-size: 1.5rem;
    }
    
    .subject-card p {
        font-size: 1rem;
    }
    
    .subject-links a {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .subject-card::after {
        font-size: 1.5rem;
        top: 1.25rem;
        right: 1.25rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.subject-card {
    animation: cardAppear 0.6s ease-out;
    animation-fill-mode: both;
}

/* Staggered animation for cards */
.subject-card:nth-child(1) { animation-delay: 0.1s; }
.subject-card:nth-child(2) { animation-delay: 0.15s; }
.subject-card:nth-child(3) { animation-delay: 0.2s; }
.subject-card:nth-child(4) { animation-delay: 0.25s; }
.subject-card:nth-child(5) { animation-delay: 0.3s; }
.subject-card:nth-child(6) { animation-delay: 0.35s; }
.subject-card:nth-child(7) { animation-delay: 0.4s; }
.subject-card:nth-child(8) { animation-delay: 0.45s; }

/* ===== PRINT STYLES ===== */
@media print {
    .subjects {
        background: white !important;
        padding: 2rem 0;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        box-shadow: none !important;
    }
    
    .subject-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        transform: none !important;
        margin-bottom: 1rem;
    }
    
    .subject-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .subject-links a {
        background: white !important;
        color: black !important;
        border: 1px solid #e2e8f0 !important;
        text-decoration: underline;
    }
    
    .subject-card::after {
        display: none;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .subject-card,
    .subject-links a,
    .subject-card::before {
        animation: none !important;
        transition: none !important;
    }
    
    .subject-card:hover {
        transform: none !important;
    }
}