/**
 * Previous Year Question Papers - Enhanced Styles
 * Optimized for performance and user experience
 */

/* Base Styles */
.pyq-container {
    background: #f8f9fa;
    min-height: 100vh;
}

/* Header Styles */
.pyq-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.pyq-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.pyq-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.pyq-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* Filter Section */
.pyq-filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: -30px 0 30px 0;
    position: relative;
    z-index: 10;
}

/* Card Styles */
.pyq-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
    position: relative;
}

.pyq-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.pyq-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 12px 12px 0 0;
}

/* Year Badge */
.pyq-year-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Subject Grid */
.pyq-subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pyq-subject-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pyq-subject-card:hover {
    border-color: #667eea;
    background: white;
    transform: translateY(-2px);
}

.pyq-subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #667eea;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.pyq-subject-card:hover::before {
    transform: scaleY(1);
}

.pyq-subject-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Download Buttons */
.pyq-download-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pyq-download-btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pyq-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.pyq-download-btn:hover::before {
    left: 100%;
}

.btn-question-paper {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-marking-scheme {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-solutions {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.pyq-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

/* Stats */
.pyq-stats {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.pyq-stat {
    background: #ecf0f1;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.pyq-stat:hover {
    background: #d5dbdb;
}

.difficulty-easy {
    color: #27ae60;
    font-weight: 600;
}

.difficulty-medium {
    color: #f39c12;
    font-weight: 600;
}

.difficulty-hard {
    color: #e74c3c;
    font-weight: 600;
}

/* Class Selector */
.pyq-class-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.class-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.class-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    z-index: -1;
}

.class-btn:hover::before,
.class-btn.active::before {
    width: 100%;
}

.class-btn:hover,
.class-btn.active {
    color: white;
    border-color: #667eea;
    text-decoration: none;
}

/* Info Section */
.pyq-info-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* FAQ Styles */
.pyq-faq {
    margin-top: 40px;
}

.faq-item {
    /* background: white; */
    border-radius: 8px;
    margin-bottom: 0;
    /* overflow: hidden; */
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.05); */
    /* transition: all 0.3s ease; */
}

/* .faq-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
} */

.faq-question {
    background: #f8f9fa;
    padding: 20px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question span {
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 20px;
    color: #6c757d;
    line-height: 1.6;
    background: white;
}

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

.pyq-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pyq-header h1 {
        font-size: 2rem;
    }
    
    .pyq-header p {
        font-size: 1rem;
    }
    
    .pyq-subject-grid {
        grid-template-columns: 1fr;
    }
    
    .pyq-download-links {
        flex-direction: column;
    }
    
    .pyq-class-selector {
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .class-btn {
        min-width: 120px;
        text-align: center;
    }
    
    .pyq-stats {
        justify-content: center;
    }
    
    .pyq-filters {
        padding: 15px;
        margin: -20px 0 20px 0;
    }
}

@media (max-width: 480px) {
    .pyq-header {
        padding: 30px 0;
    }
    
    .pyq-header h1 {
        font-size: 1.8rem;
    }
    
    .pyq-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .pyq-subject-card {
        padding: 15px;
    }
    
    .pyq-download-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* Print Styles */
@media print {
    .pyq-header,
    .pyq-filters,
    .pyq-class-selector,
    .pyq-download-links {
        display: none;
    }
    
    .pyq-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .pyq-subject-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pyq-container {
        background: #fff;
    }
    
    /* .pyq-card,
    .pyq-info-section,
    .faq-item {
        background: #2d2d2d;
        color: #e0e0e0;
    } */
    
    .pyq-subject-card {
        background: #3a3a3a;
        border-color: #555;
    }
    
    .pyq-subject-title,
    .faq-question {
        color: #e0e0e0;
    }
    
    .faq-question {
        background: #3a3a3a;
    }
    
    .faq-answer {
        color: #b0b0b0;
    }
}

/* Accessibility Improvements */
.pyq-download-btn:focus,
.class-btn:focus,
.faq-question:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pyq-card,
    .pyq-download-btn,
    .class-btn,
    .pyq-subject-card {
        transition: none;
    }
    
    .pyq-card:hover {
        transform: none;
    }
}
