/* video-lessons.css - Modern Design 2025 */

/* Root variables for consistent theming */
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #5e7eff;
    --secondary-color: #2d3748;
    --accent-color: #7209b7;
    --accent-light: #9d4edd;
    --neutral-color: #f8f9fa;
    --light-color: #ffffff;
    --dark-color: #1a202c;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #1a202c;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --border-radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition-fast: all 0.2s ease;
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Base styling */
body {
    font-family: var(--font-sans);
    color: var(--secondary-color);
    background-color: var(--light-color);
    line-height: 1.7;
}

/* Modern Video Lessons Container */
.video-lessons-container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    background-color: var(--light-color);
    position: relative;
    transition: all 0.5s ease;
}

/* Бүтэн дэлгэцийн загвар */
.video-lessons-container.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-width: none;
    margin: 0;
    z-index: 9999;
    overflow-y: auto;
    padding: 2.5rem;
    border-radius: 0;
    box-shadow: none;
}

/* Өргөтгөх/хураах товч */
.fullscreen-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.fullscreen-toggle button {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.fullscreen-toggle button:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Бүтэн дэлгэц үед харагдах харсан товч */
.fullscreen-toggle button:active {
    transform: scale(0.95);
}

/* Бүтэн дэлгэц үед scroll хийх боломжтой болгох */
.fullscreen-mode {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.1);
}

/* Бүтэн дэлгэц үед scroll bar загварчлах */
.fullscreen-mode::-webkit-scrollbar {
    width: 8px;
}

.fullscreen-mode::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.fullscreen-mode::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.fullscreen-mode::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Контейнерийн хүрээ, радиус, сүүдэр */
.container-with-border {
    border-radius: var(--border-radius-lg);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.05),
        0 1px 8px rgba(0, 0, 0, 0.03),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    background-image: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 1),
        rgba(248, 250, 252, 0.9)
    );
    position: relative;
    overflow: hidden;
}

/* Дизайны хөндлөн зураас, тал туш */
.container-with-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(
        to right, 
        var(--primary-color), 
        var(--accent-color),
        var(--info),
        var(--success)
    );
    z-index: 1;
}

/* Контэйнэрийн доор гоё зураас нэмэх */
.container-with-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0)
    );
    z-index: 1;
}

/* Нарны гэрэл эффект - дээд буланд */
.container-with-border .light-effect {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

/* Title Section */
.title-section {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 2rem;
    padding-top: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.title-section:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: var(--border-radius-full);
    box-shadow: 0 1px 10px rgba(108, 92, 231, 0.2);
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    background: linear-gradient(120deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    display: inline-block;
}

.main-title::before,
.main-title::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0.3;
    background-image: 
        radial-gradient(circle, var(--accent-color) 30%, transparent 30%),
        radial-gradient(circle, var(--accent-color) 30%, transparent 30%);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
}

.main-title::before {
    top: 5px;
    left: -30px;
}

.main-title::after {
    bottom: 5px;
    right: -30px;
}

.description {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    padding: 0 40px;
}

/* Modern Filter Toolbar */
.filter-toolbar {
    margin-bottom: 2rem;
}

.filter-menu-container {
    position: relative;
}

.filter-icons-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background-color: var(--light-color);
    padding: 0.75rem;
    border-radius: var(--border-radius-full);
    box-shadow: var(--shadow-sm);
    margin: 0 auto;
    max-width: fit-content;
    border: 1px solid var(--gray-200);
}

.filter-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    background-color: var(--gray-100);
    color: var(--gray-700);
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
}

.filter-icon:hover {
    background-color: var(--gray-200);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.filter-icon.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

.filter-icon i {
    font-size: 1.25rem;
}

.filter-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid white;
}

.favorites-icon {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.favorites-icon:hover {
    background-color: #ffca2c !important;
}

.favorites-icon a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

.favorites-icon .badge {
    background-color: #212529;
}

.filter-panels {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 100;
    margin-top: 0.75rem;
}

.filter-panel {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-200);
    position: absolute;
    z-index: 1000;
    top: calc(100% + 10px);
    left: 50%;
    width: 90%;
    max-width: 300px;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    /* Хөдөлгөөнөөс хасах */
    animation: none;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.filter-panel.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* Хөдөлгөөнт эффектүүдийг хасах */
    transform: translateX(-50%);
    animation: none;
}

/* Панелийн гарчиг болон хаах товч */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.panel-close-btn {
    background: transparent;
    border: none;
    color: var(--gray-500);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.panel-close-btn:hover {
    background-color: var(--gray-100);
    color: var(--danger);
    transform: scale(1.05);
}

.panel-close-btn:active {
    transform: scale(0.95);
}

/* Хуучин animation-ийг хасах */
/* 
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 
*/

.search-input-group,
.clear-input-group {
    position: relative;
    display: flex;
    height: 3.25rem;
}

.search-input {
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-full);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    height: 3.25rem;
    background-color: var(--light-color);
    transition: var(--transition);
    color: var(--gray-800);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.2);
    outline: none;
}

.search-input::placeholder {
    color: var(--gray-500);
}

.search-btn, 
.clear-btn {
    position: absolute;
    top: 50%;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-btn {
    right: 0.5rem;
    transform: translateY(-50%);
}

.clear-btn {
    /* Different color for clear button */
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    right: 3.25rem;
    transform: translateY(-50%);
}

.search-btn:hover,
.clear-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--shadow-md);
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-color));
}

.clear-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.minimal-select {
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-full);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    height: 3.25rem;
    background-color: var(--light-color);
    transition: var(--transition);
    cursor: pointer;
    appearance: none;
    color: var(--gray-800);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234361ee' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.85rem;
}

/* Эрхгүй категорийн загвар */
.locked-category {
    color: var(--gray-500);
    background-color: rgba(239, 68, 68, 0.05);
    font-style: italic;
}

.minimal-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.2);
    outline: none;
}

.clear-filters-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--light-color);
    color: var(--gray-600);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.clear-filters-button:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* Filter Notifications */
.filter-notification {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.5s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.notification-text {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.filter-notification i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
}

.filter-notification strong {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    width: 100%;
}

.filter-notification strong i {
    margin-right: 0.5rem;
}

.filter-notification ul {
    list-style: none;
    padding-left: 1rem;
    margin-bottom: 0;
    width: 100%;
}

.filter-notification li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.filter-notification li button {
    margin-left: auto;
}

/* Хаах товч */
.notification-close {
    background: transparent;
    border: none;
    color: currentColor;
    opacity: 0.7;
    font-size: 1.25rem;
    padding: 0;
    margin-left: 1rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    align-self: flex-start;
}

.notification-close:hover {
    opacity: 1;
}

/* Тоолуур */
.countdown-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    margin-left: 0.75rem;
    font-weight: bold;
    font-size: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: pulseTimer 1s infinite;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

@keyframes pulseTimer {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Төрөл бүрийн өнгөтэй мэдэгдлүүд */
.search-notification {
    background-color: rgba(59, 130, 246, 0.08);
    color: var(--info);
    border-left-color: var(--info);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.1);
}

.search-notification .countdown-timer {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.3);
}

.level-notification {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border-left-color: var(--success);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.1);
}

.level-notification .countdown-timer {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.category-notification {
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border-left-color: var(--warning);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.1);
}

.category-notification .countdown-timer {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.locked-notification {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border-left-color: var(--danger);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.1);
}

.locked-notification .countdown-timer {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Нэмэлт анимейшн */
@keyframes slideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Buy Access Button */
.buy-access-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--danger), #e02d4b);
    color: white;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.buy-access-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Pagination */
.pagination {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
}

.pagination .page-item {
    margin: 0 0.25rem;
}

.pagination .page-link {
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
    padding: 0.5rem 0.75rem;
    min-width: 2.5rem;
    text-align: center;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-link:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.pagination .page-item.disabled .page-link {
    color: var(--gray-400);
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    opacity: 0.7;
    cursor: not-allowed;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

.video-lesson-card {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--index, 0) * 0.1s);
}

/* No results */
.no-results-message {
    text-align: center;
    padding: 3rem 1rem;
    background-color: var(--gray-100);
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
}

.no-results-message i {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
    display: block;
}

.no-results-message h4 {
    font-size: 1.5rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.no-results-message p {
    color: var(--gray-600);
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .main-title {
        font-size: 2rem;
    }
    
    .search-filter-container {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 1.75rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .title-section {
        margin-bottom: 2rem;
    }
    
    .video-lessons-container {
        padding: 1.5rem 0.75rem;
    }
    
    .filter-notification {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 576px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .search-input,
    .minimal-select {
        height: 3rem;
        padding: 0.625rem 1.25rem;
    }
    
    .pagination .page-link {
        min-width: 2.25rem;
        padding: 0.4rem 0.5rem;
    }
    
    .search-btn {
        width: 2.25rem;
        height: 2.25rem;
    }
}