/**
 * Enhanced Modules System - Modern & Engaging Design
 * Interactive UI for learning modules, payment, and study experience
 */

/* ===== MODERN VARIABLES (match site colors: amber accent #F59E0B) ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #137463 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
}

/* Hero section for modules: image background + foreground content defined in page-specific.css (same structure & colors as cctv/services). */

/* ===== DEPARTMENT SELECTOR ===== */
.department-selector {
    padding: 3rem 0;
    background: var(--bg-light);
}

.selector-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.selector-tab {
    background: var(--bg-white);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.selector-tab::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.5s;
}

.selector-tab:hover::before {
    left: 100%;
}

.selector-tab:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: #968007;
}

.selector-tab.active {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

.tab-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #667eea;
    transition: var(--transition);
}

.selector-tab.active .tab-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.tab-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tab-content p {
    opacity: 0.8;
    font-size: 0.95rem;
}

/* ===== ENHANCED MODULE CARDS ===== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.module-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.module-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--card-shadow-hover);
}

.module-card--free::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--success-gradient);
    z-index: 2;
}

.module-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.module-price {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(177, 130, 1, 0.3);
}

.module-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.module-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.module-card--free .module-icon {
    background: var(--success-gradient);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.3);
}

.module-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.module-content {
    padding: 0 2rem 1.5rem;
}

.module-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.module-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.feature i {
    color: #667eea;
    width: 16px;
}

/* ===== INSTRUCTOR INFO ===== */
.instructor-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.instructor-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.instructor-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.instructor-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.instructor-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #f6ad55;
}

/* ===== ENHANCED BUTTONS ===== */
.module-footer {
    padding: 0 2rem 2rem;
}

.module-btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn--primary.module-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn--success.module-btn {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn--outline.module-btn {
    background: transparent;
    color: #7c5305;
    border: 2px solid #667eea77;
    box-shadow: none;
}

.module-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn--success.module-btn:hover {
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.6);
}

.btn--outline.module-btn:hover {
    background: #667eea;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ===== DEPARTMENT STATS ===== */
.department-header {
    text-align: center;
    margin-bottom: 3rem;
}

.department-info {
    max-width: 800px;
    margin: 0 auto;
}

.department-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.department-details h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.department-details p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.department-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-white);
    border-radius: 25px;
    box-shadow: var(--card-shadow);
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat i {
    color: #667eea;
}

/* ===== PROGRESS SECTION ===== */
.progress-section {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.progress-section::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"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 15s ease-in-out infinite reverse;
}

.progress-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
    position: relative;
    z-index: 2;
}

.progress-info h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.progress-info p {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.progress-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

/* ===== NO MODULES STATE ===== */
.no-modules {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-modules i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.no-modules h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero__title {
        font-size: 2.5rem;
    }
    
    .selector-tabs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .department-stats {
        gap: 1rem;
    }
    
    .stat {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .progress-content {
        flex-direction: column;
        text-align: center;
    }
    
    .progress-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .department-details h2 {
        font-size: 2rem;
    }
    
    .module-features {
        grid-template-columns: 1fr;
    }
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading .module-btn {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===== HOVER EFFECTS ===== */
.module-card:hover .module-icon {
    transform: scale(1.1) rotate(5deg);
}

.module-card:hover .instructor-avatar {
    transform: scale(1.1);
}

/* ===== DEPARTMENT MODULES VISIBILITY ===== */
.department-modules {
    display: none;
}

.department-modules.active {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
