/**
 * SaralStudy UI Components
 * 
 * Specialized component styles for enhanced user interface
 * 
 * @package SaralStudy\Frontend
 * @version 1.0
 */

/* =============================================
   HEADER COMPONENTS
   ============================================= */

.saral-header {
    background: white;
    box-shadow: var(--saral-shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--saral-z-sticky);
    transition: all var(--saral-transition-normal);
}

.saral-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--saral-space-4) var(--saral-space-3);
    max-width: var(--saral-container-2xl);
    margin: 0 auto;
}

.saral-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    font-size: var(--saral-font-size-xl);
    color: var(--saral-primary);
    transition: all var(--saral-transition-fast);
}

.saral-logo:hover {
    transform: scale(1.05);
}

.saral-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--saral-primary);
    color: white;
    border-radius: var(--saral-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: var(--saral-font-size-lg);
    margin-right: var(--saral-space-3);
}

.saral-logo-text {
    font-size: var(--saral-font-size-2xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--saral-primary), var(--saral-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   SEARCH COMPONENTS
   ============================================= */

.saral-search-container {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.saral-search-input {
    width: 100%;
    padding: var(--saral-space-3) var(--saral-space-4) var(--saral-space-3) var(--saral-space-12);
    font-size: var(--saral-font-size-base);
    border: 2px solid var(--saral-gray-200);
    border-radius: var(--saral-radius-xl);
    background-color: var(--saral-gray-50);
    transition: all var(--saral-transition-fast);
}

.saral-search-input:focus {
    border-color: var(--saral-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: white;
}

.saral-search-icon {
    position: absolute;
    left: var(--saral-space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--saral-gray-400);
    font-size: var(--saral-font-size-lg);
    pointer-events: none;
    transition: color var(--saral-transition-fast);
}

.saral-search-input:focus + .saral-search-icon {
    color: var(--saral-primary);
}

.saral-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--saral-gray-200);
    border-top: none;
    border-radius: var(--saral-radius-lg);
    box-shadow: var(--saral-shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: var(--saral-z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--saral-transition-fast);
}

.saral-search-suggestions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.saral-search-suggestion {
    padding: var(--saral-space-3) var(--saral-space-4);
    border-bottom: 1px solid var(--saral-gray-100);
    cursor: pointer;
    transition: all var(--saral-transition-fast);
    display: flex;
    align-items: center;
    gap: var(--saral-space-3);
}

.saral-search-suggestion:hover {
    background-color: var(--saral-gray-50);
}

.saral-search-suggestion:last-child {
    border-bottom: none;
}

.saral-search-suggestion-icon {
    color: var(--saral-gray-400);
    font-size: var(--saral-font-size-sm);
}

.saral-search-suggestion-text {
    flex: 1;
    font-size: var(--saral-font-size-sm);
    color: var(--saral-gray-700);
}

.saral-search-suggestion-type {
    font-size: var(--saral-font-size-xs);
    color: var(--saral-gray-400);
    text-transform: uppercase;
    letter-spacing: var(--saral-letter-spacing-wide);
}

/* =============================================
   HERO SECTION
   ============================================= */

.saral-hero {
    background: linear-gradient(135deg, var(--saral-primary) 0%, var(--saral-secondary) 100%);
    color: white;
    padding: var(--saral-space-20) 0;
    position: relative;
    overflow: hidden;
}

.saral-hero::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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)" /></svg>');
    opacity: 0.3;
}

.saral-hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--saral-container-xl);
    margin: 0 auto;
    text-align: center;
}

.saral-hero-title {
    font-size: var(--saral-font-size-5xl);
    font-weight: 800;
    line-height: var(--saral-line-height-tight);
    margin-bottom: var(--saral-space-6);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.saral-hero-subtitle {
    font-size: var(--saral-font-size-xl);
    line-height: var(--saral-line-height-normal);
    margin-bottom: var(--saral-space-8);
    opacity: 0.9;
    max-width: 600px;
}

.saral-hero-search {
    max-width: 600px;
    margin: 0 auto var(--saral-space-8);
}

.saral-hero-search-input {
    padding: var(--saral-space-6) var(--saral-space-8);
    font-size: var(--saral-font-size-lg);
    border: none;
    border-radius: var(--saral-radius-2xl);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
}

.saral-hero-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.saral-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--saral-space-6);
    margin-top: var(--saral-space-12);
}

.saral-hero-stat {
    text-align: center;
    padding: var(--saral-space-4);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--saral-radius-lg);
    backdrop-filter: blur(10px);
}

.saral-hero-stat-number {
    display: block;
    font-size: var(--saral-font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--saral-space-2);
}

.saral-hero-stat-label {
    font-size: var(--saral-font-size-sm);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: var(--saral-letter-spacing-wide);
}

/* =============================================
   SUBJECT CARDS
   ============================================= */

.saral-subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--saral-space-6);
    margin: var(--saral-space-8) 0;
}

.saral-subject-card {
    background: white;
    border-radius: var(--saral-radius-xl);
    padding: var(--saral-space-6);
    box-shadow: var(--saral-shadow-md);
    transition: all var(--saral-transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.saral-subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--subject-color, var(--saral-primary));
    transition: all var(--saral-transition-fast);
}

.saral-subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--saral-shadow-xl);
}

.saral-subject-card:hover::before {
    height: 8px;
}

.saral-subject-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--subject-color, var(--saral-primary)), var(--subject-color, var(--saral-secondary)));
    color: white;
    border-radius: var(--saral-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--saral-font-size-2xl);
    margin-bottom: var(--saral-space-4);
    transition: all var(--saral-transition-fast);
}

.saral-subject-card:hover .saral-subject-icon {
    transform: scale(1.1) rotate(5deg);
}

.saral-subject-title {
    font-size: var(--saral-font-size-xl);
    font-weight: 700;
    color: var(--saral-gray-900);
    margin-bottom: var(--saral-space-3);
}

.saral-subject-description {
    font-size: var(--saral-font-size-sm);
    color: var(--saral-gray-600);
    line-height: var(--saral-line-height-normal);
    margin-bottom: var(--saral-space-4);
}

.saral-subject-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--saral-space-4);
}

.saral-subject-stat {
    display: flex;
    align-items: center;
    gap: var(--saral-space-2);
    font-size: var(--saral-font-size-xs);
    color: var(--saral-gray-500);
}

.saral-subject-stat i {
    font-size: var(--saral-font-size-sm);
}

/* =============================================
   CLASS NAVIGATION
   ============================================= */

.saral-class-nav {
    background: var(--saral-gray-50);
    padding: var(--saral-space-8) 0;
}

.saral-class-nav-title {
    text-align: center;
    font-size: var(--saral-font-size-3xl);
    font-weight: 800;
    color: var(--saral-gray-900);
    margin-bottom: var(--saral-space-8);
}

.saral-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--saral-space-6);
    max-width: var(--saral-container-2xl);
    margin: 0 auto;
}

.saral-class-item {
    background: white;
    border-radius: var(--saral-radius-lg);
    padding: var(--saral-space-6);
    box-shadow: var(--saral-shadow-sm);
    transition: all var(--saral-transition-fast);
    text-decoration: none;
    color: var(--saral-gray-900);
    display: flex;
    align-items: center;
    gap: var(--saral-space-4);
    border: 2px solid var(--saral-gray-200);
}

.saral-class-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--saral-shadow-lg);
    border-color: var(--saral-primary);
}

.saral-class-icon {
    width: 50px;
    height: 50px;
    background: var(--saral-primary);
    color: white;
    border-radius: var(--saral-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: var(--saral-font-size-lg);
    flex-shrink: 0;
}

.saral-class-info {
    flex: 1;
}

.saral-class-name {
    font-size: var(--saral-font-size-lg);
    font-weight: 600;
    color: var(--saral-gray-900);
    margin-bottom: var(--saral-space-1);
}

.saral-class-description {
    font-size: var(--saral-font-size-sm);
    color: var(--saral-gray-600);
}

/* =============================================
   FEATURE CARDS
   ============================================= */

.saral-features {
    padding: var(--saral-space-16) 0;
    background: var(--saral-gray-50);
}

.saral-features-container {
    max-width: var(--saral-container-2xl);
    margin: 0 auto;
}

.saral-features-header {
    text-align: center;
    margin-bottom: var(--saral-space-12);
}

.saral-features-title {
    font-size: var(--saral-font-size-4xl);
    font-weight: 800;
    color: var(--saral-gray-900);
    margin-bottom: var(--saral-space-4);
}

.saral-features-subtitle {
    font-size: var(--saral-font-size-xl);
    color: var(--saral-gray-600);
    max-width: 600px;
    margin: 0 auto;
}

.saral-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--saral-space-8);
}

.saral-feature-card {
    background: white;
    border-radius: var(--saral-radius-xl);
    padding: var(--saral-space-8);
    box-shadow: var(--saral-shadow-md);
    transition: all var(--saral-transition-normal);
    text-align: center;
    height: 100%;
    border: 2px solid var(--saral-gray-200);
}

.saral-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--saral-shadow-xl);
    border-color: var(--feature-color, var(--saral-primary));
}

.saral-feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--feature-color, var(--saral-primary)), var(--feature-color, var(--saral-secondary)));
    color: white;
    border-radius: var(--saral-radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--saral-font-size-3xl);
    margin: 0 auto var(--saral-space-6);
    transition: all var(--saral-transition-fast);
}

.saral-feature-card:hover .saral-feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.saral-feature-title {
    font-size: var(--saral-font-size-xl);
    font-weight: 700;
    color: var(--saral-gray-900);
    margin-bottom: var(--saral-space-4);
}

.saral-feature-description {
    font-size: var(--saral-font-size-base);
    color: var(--saral-gray-600);
    line-height: var(--saral-line-height-normal);
}

/* =============================================
   TESTIMONIALS
   ============================================= */

.saral-testimonials {
    padding: var(--saral-space-16) 0;
    background: linear-gradient(135deg, var(--saral-gray-50) 0%, var(--saral-gray-100) 100%);
}

.saral-testimonials-container {
    max-width: var(--saral-container-xl);
    margin: 0 auto;
}

.saral-testimonials-header {
    text-align: center;
    margin-bottom: var(--saral-space-12);
}

.saral-testimonials-title {
    font-size: var(--saral-font-size-4xl);
    font-weight: 800;
    color: var(--saral-gray-900);
    margin-bottom: var(--saral-space-4);
}

.saral-testimonials-subtitle {
    font-size: var(--saral-font-size-xl);
    color: var(--saral-gray-600);
    max-width: 600px;
    margin: 0 auto;
}

.saral-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--saral-space-8);
}

.saral-testimonial-card {
    background: white;
    border-radius: var(--saral-radius-xl);
    padding: var(--saral-space-8);
    box-shadow: var(--saral-shadow-lg);
    transition: all var(--saral-transition-normal);
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid var(--saral-gray-200);
}

.saral-testimonial-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--saral-primary), var(--saral-secondary));
    border-radius: var(--saral-radius-xl);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--saral-transition-fast);
}

.saral-testimonial-card:hover::before {
    opacity: 0.1;
}

.saral-testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--saral-shadow-2xl);
}

.saral-testimonial-rating {
    margin-bottom: var(--saral-space-4);
    text-align: center;
}

.saral-testimonial-text {
    font-size: var(--saral-font-size-base);
    color: var(--saral-gray-700);
    line-height: var(--saral-line-height-normal);
    font-style: italic;
    margin-bottom: var(--saral-space-6);
    position: relative;
    padding: 0 var(--saral-space-4);
}

.saral-testimonial-text::before,
.saral-testimonial-text::after {
    content: '"';
    font-size: var(--saral-font-size-4xl);
    color: var(--saral-gray-200);
    position: absolute;
    font-family: var(--saral-font-mono);
}

.saral-testimonial-text::before {
    top: -10px;
    left: -10px;
}

.saral-testimonial-text::after {
    bottom: -20px;
    right: -10px;
}

.saral-testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--saral-space-4);
}

.saral-testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--saral-radius-full);
    background: var(--saral-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: var(--saral-font-size-lg);
    flex-shrink: 0;
}

.saral-testimonial-info {
    flex: 1;
}

.saral-testimonial-name {
    font-size: var(--saral-font-size-lg);
    font-weight: 600;
    color: var(--saral-gray-900);
    margin-bottom: var(--saral-space-1);
}

.saral-testimonial-role {
    font-size: var(--saral-font-size-sm);
    color: var(--saral-gray-600);
}

/* =============================================
   FOOTER
   ============================================= */

.saral-footer {
    background: var(--saral-gray-900);
    color: var(--saral-gray-300);
    padding: var(--saral-space-16) 0 var(--saral-space-8);
}

.saral-footer-container {
    max-width: var(--saral-container-xl);
    margin: 0 auto;
}

.saral-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--saral-space-8);
    margin-bottom: var(--saral-space-12);
}

.saral-footer-section h3 {
    font-size: var(--saral-font-size-lg);
    font-weight: 600;
    color: white;
    margin-bottom: var(--saral-space-4);
}

.saral-footer-links {
    list-style: none;
}

.saral-footer-links li {
    margin-bottom: var(--saral-space-2);
}

.saral-footer-links a {
    color: var(--saral-gray-400);
    text-decoration: none;
    font-size: var(--saral-font-size-sm);
    transition: color var(--saral-transition-fast);
}

.saral-footer-links a:hover {
    color: white;
}

.saral-footer-social {
    display: flex;
    gap: var(--saral-space-4);
    margin-top: var(--saral-space-4);
}

.saral-footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--saral-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--saral-gray-400);
    text-decoration: none;
    transition: all var(--saral-transition-fast);
}

.saral-footer-social a:hover {
    background: var(--saral-primary);
    color: white;
    transform: translateY(-2px);
}

.saral-footer-bottom {
    border-top: 1px solid var(--saral-gray-800);
    padding-top: var(--saral-space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--saral-space-4);
}

.saral-footer-copyright {
    color: var(--saral-gray-500);
    font-size: var(--saral-font-size-sm);
}

.saral-footer-made-with {
    color: var(--saral-gray-400);
    font-size: var(--saral-font-size-sm);
}

/* =============================================
   MOBILE NAVIGATION
   ============================================= */

.saral-mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--saral-gray-700);
    font-size: var(--saral-font-size-xl);
    cursor: pointer;
    padding: var(--saral-space-2);
}

.saral-mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: var(--saral-shadow-2xl);
    z-index: var(--saral-z-modal);
    transition: left var(--saral-transition-normal);
    overflow-y: auto;
}

.saral-mobile-menu.active {
    left: 0;
}

.saral-mobile-menu-header {
    padding: var(--saral-space-4);
    border-bottom: 1px solid var(--saral-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saral-mobile-menu-close {
    background: none;
    border: none;
    font-size: var(--saral-font-size-xl);
    color: var(--saral-gray-400);
    cursor: pointer;
    padding: var(--saral-space-2);
}

.saral-mobile-menu-nav {
    padding: var(--saral-space-4);
}

.saral-mobile-menu-link {
    display: block;
    padding: var(--saral-space-3) var(--saral-space-4);
    color: var(--saral-gray-700);
    text-decoration: none;
    border-radius: var(--saral-radius-md);
    transition: all var(--saral-transition-fast);
    margin-bottom: var(--saral-space-2);
}

.saral-mobile-menu-link:hover {
    background-color: var(--saral-gray-100);
    color: var(--saral-primary);
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

@media (max-width: 768px) {
    .saral-header-container {
        padding: var(--saral-space-3) var(--saral-space-2);
    }
    
    .saral-nav {
        display: none;
    }
    
    .saral-mobile-menu-toggle {
        display: block;
    }
    
    .saral-hero-title {
        font-size: var(--saral-font-size-3xl);
    }
    
    .saral-hero-subtitle {
        font-size: var(--saral-font-size-lg);
    }
    
    .saral-hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--saral-space-4);
    }
    
    .saral-subject-grid {
        grid-template-columns: 1fr;
        gap: var(--saral-space-4);
    }
    
    .saral-class-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--saral-space-4);
    }
    
    .saral-features-grid {
        grid-template-columns: 1fr;
        gap: var(--saral-space-6);
    }
    
    .saral-testimonials-grid {
        grid-template-columns: 1fr;
        gap: var(--saral-space-6);
    }
    
    .saral-footer-grid {
        grid-template-columns: 1fr;
        gap: var(--saral-space-6);
    }
    
    .saral-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: var(--saral-space-2);
    }
}

@media (max-width: 640px) {
    .saral-hero-stats {
        grid-template-columns: 1fr;
        gap: var(--saral-space-3);
    }
    
    .saral-class-grid {
        grid-template-columns: 1fr;
    }
    
    .saral-subject-card,
    .saral-feature-card,
    .saral-testimonial-card {
        padding: var(--saral-space-4);
    }
    
    .saral-subject-icon,
    .saral-feature-icon {
        width: 50px;
        height: 50px;
        font-size: var(--saral-font-size-xl);
        margin-bottom: var(--saral-space-3);
    }
}

/* =============================================
   ANIMATION ENHANCEMENTS
   ============================================= */

.saral-animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--saral-transition-slow);
}

.saral-animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.saral-stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: saral-fadeIn 0.6s ease-out forwards;
}

.saral-stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.saral-stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.saral-stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.saral-stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.saral-stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.saral-stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
