/* CSS Variables for Theme Management */
:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --accent-primary: #dc3545;
    --accent-secondary: #0d6efd;
    --border-color: #dee2e6;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --overlay: rgba(0, 0, 0, 0.7);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #dc3545 0%, #0d6efd 100%);
    --gradient-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    
    /* Measurements */
    --container-max-width: 1400px;
    --border-radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-elevation: 0 4px 20px var(--shadow-light);
}

/* Dark Theme (Netflix-style) */
[data-theme="dark"] {
    --bg-primary: #141414;
    --bg-secondary: #2f2f2f;
    --bg-tertiary: #404040;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #404040;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --overlay: rgba(0, 0, 0, 0.8);
    --gradient-bg: #141414;
    --shadow-elevation: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
    margin: 0;
    opacity: 0;
    animation: pageLoad 0.8s ease-out forwards;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.company-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1.2rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.search-box {
    position: relative;
    width: 300px;
    height: 40px;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    width: 16px;
    height: 16px;
}

.search-box input {
    width: 100%;
    height: 100%;
    padding: 0 1rem 0 3rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
}

.user-avatar {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar:hover {
    background: var(--bg-tertiary);
}

.user-avatar i {
    width: 18px;
    height: 18px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-elevation);
    min-width: 160px;
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-10px);
    animation: dropdownItemSlide 0.3s ease-out forwards;
}

.dropdown-item:nth-child(1) { animation-delay: 0.1s; }
.dropdown-item:nth-child(2) { animation-delay: 0.2s; }

@keyframes dropdownItemSlide {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    transform: translateX(5px);
}

/* Category Section */
.category-section {
    background: var(--bg-primary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.category-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-right: 0.5rem;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.category-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--accent-primary);
    color: white;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-action-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-action-btn:hover {
    background: #b02a37;
    transform: translateY(-2px);
}

.video-admin-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
    pointer-events: none;
}

.video-card:hover .video-admin-actions {
    opacity: 1;
    pointer-events: auto;
}

.admin-btn {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    z-index: 20;
}

.admin-btn:hover {
    transform: scale(1.1);
}

.admin-btn.edit-btn {
    background: rgba(13, 110, 253, 0.9);
}

.admin-btn.delete-btn {
    background: rgba(220, 53, 69, 0.9);
}

.hidden {
    display: none !important;
}

/* Main Content */
.main {
    padding: 3rem 0;
    min-height: 60vh;
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.video-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: cardSlideIn 0.6s ease-out forwards;
}

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

@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card:hover {
    transform: scale(1.05) translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    opacity: 0;
}

.video-card:hover .play-overlay {
    opacity: 1;
    background: var(--accent-primary);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-content {
    padding: 1rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.video-card:hover .video-content {
    opacity: 1;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.video-theme,
.video-subject {
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.video-theme {
    background: var(--accent-primary);
    color: white;
}

.video-subject {
    background: var(--accent-secondary);
    color: white;
}

.video-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    display: flex;
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    transform: scale(0.7) translateY(-30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video modal specific styling */
#videoModal .modal-content {
    max-width: 900px;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 2rem 2rem 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(13, 110, 253, 0.05));
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), #0d6efd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close, .modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.close:hover, .modal-close:hover {
    background: rgba(220, 53, 69, 0.2);
    color: var(--accent-primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 1rem 2rem 2rem 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 3px rgba(220, 53, 69, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #b02a37);
    color: white;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(220, 53, 69, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 8px 15px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: none;
    border-left: 4px solid;
}

.alert.success {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #28a745;
}

.alert.error {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: var(--accent-primary);
    color: var(--accent-primary);
}

.video-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 0 2rem 1rem 2rem;
}

.video-info .video-meta {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.video-info .video-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    border-left: 3px solid var(--accent-primary);
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(13, 110, 253, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag:hover {
    background: rgba(13, 110, 253, 0.2);
    transform: translateY(-2px);
}

/* Toast Notifications */
/* Admin Panel Modal */
.admin-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.admin-panel-overlay.active {
    display: flex;
}

.admin-panel-container {
    width: 95%;
    height: 90%;
    max-width: 1400px;
    background: var(--background-secondary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.admin-panel-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.admin-panel-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.admin-panel-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.admin-panel-content {
    height: calc(100% - 80px);
    position: relative;
}

.admin-panel-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    transform: translateX(120%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 2px 0 0 2px;
}

.toast.success::before {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.toast.error::before {
    background: linear-gradient(45deg, var(--accent-primary), #e74c3c);
}

.toast.info::before {
    background: linear-gradient(45deg, #0d6efd, #6f42c1);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 2px;
}

.toast.success .toast-icon {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.toast.error .toast-icon {
    background: rgba(220, 53, 69, 0.2);
    color: var(--accent-primary);
}

.toast.info .toast-icon {
    background: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

.toast-text {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.toast-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-radius: 0 0 16px 16px;
    transform-origin: left;
    animation: toastProgress 4s linear forwards;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page transition enhancements */
.main-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-fade {
    opacity: 0.7;
    transform: scale(0.98);
}

/* Enhanced button feedback */
.btn:active,
.admin-btn:active,
.category-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .logo {
        flex-direction: row;
        justify-content: center;
        text-align: center;
        gap: 0.75rem;
    }
    
    .company-logo {
        height: 35px;
    }
    
    .search-controls {
        gap: 1rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters select,
    .clear-filters {
        width: 100%;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
        max-width: 95vw;
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .video-container {
        height: 250px;
    }
    
    .modal-header,
    .video-info {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .company-logo {
        height: 30px;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .video-container {
        height: 200px;
    }
    
    .main {
        padding: 2rem 0;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        right: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Native Custom Video Player */
.video-container {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    min-height: 350px;
    border: 2px solid rgba(220, 53, 69, 0.3);
}

/* Video overlay blocker - completely blocks YouTube UI interaction */
.video-overlay-blocker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    background: transparent;
    pointer-events: all;
    cursor: default;
}

/* Block YouTube controls specifically */
.video-overlay-blocker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px; /* Leave space for our controls */
    background: transparent;
    z-index: 16;
}

/* Block YouTube title bar and loading elements */
.video-overlay-blocker::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 20;
    pointer-events: all;
}

/* Custom video display */
.custom-video-display {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.video-poster {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.video-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
}

.video-overlay-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
}

.large-play-button {
    width: 100px;
    height: 100px;
    background: rgba(220, 53, 69, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.3);
}

.large-play-button:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(220, 53, 69, 0.5);
}

.large-play-button i {
    width: 40px;
    height: 40px;
    color: white;
    margin-left: 6px;
}

.video-info {
    color: white;
    text-align: center;
}

.video-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.video-info p {
    font-size: 1rem;
    opacity: 0.8;
    max-width: 400px;
    line-height: 1.4;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

/* Video playing display */
.video-playing-display {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.video-content {
    text-align: center;
    color: white;
    width: 100%;
    padding: 40px;
}

.video-title-bar {
    margin-bottom: 40px;
}

.video-title-bar h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
}

.video-status {
    font-size: 1rem;
    color: #dc3545;
    font-weight: 500;
}

.video-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.video-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 60px;
}

.waveform-bar {
    width: 8px;
    background: linear-gradient(180deg, #dc3545, #0d6efd);
    border-radius: 4px;
    animation: waveform 1.5s ease-in-out infinite;
    opacity: 0.8;
}

.waveform-bar:nth-child(even) {
    animation-delay: 0.3s;
}

.waveform-bar:nth-child(3n) {
    animation-delay: 0.6s;
}

@keyframes waveform {
    0%, 100% { transform: scaleY(1); opacity: 0.8; }
    50% { transform: scaleY(1.5); opacity: 1; }
}

.play-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #28a745;
    font-size: 1.1rem;
    font-weight: 500;
}

.play-indicator i {
    width: 20px;
    height: 20px;
}

/* Native custom video controls - highest z-index */
.native-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    padding: 25px 20px 20px 20px;
    z-index: 50;
    backdrop-filter: blur(15px);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    pointer-events: all;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.native-control-btn {
    width: 50px;
    height: 50px;
    background: rgba(220, 53, 69, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.native-control-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.native-control-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.native-control-btn i {
    width: 22px;
    height: 22px;
}

.play-pause-btn i {
    margin-left: 2px;
}

.progress-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.time-display {
    color: white;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', monospace;
    min-width: 45px;
    text-align: center;
}

.progress-container {
    flex: 1;
    position: relative;
    height: 8px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-track:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scaleY(1.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545, #fd7e14);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-container:hover .progress-handle,
.progress-handle.dragging {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

/* Fullscreen support */
.video-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.video-container:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.video-container:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

/* Additional YouTube blocking and UI hiding */
iframe[src*="youtube.com"] {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Hide all YouTube UI elements completely */
iframe[src*="youtube.com"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    pointer-events: all;
}

/* Prevent any YouTube interface interaction */
.video-container iframe:focus {
    outline: none !important;
}

.video-container iframe:hover {
    cursor: default !important;
}

/* Hide YouTube loading and buffer indicators */
.video-container {
    overflow: hidden !important;
}

.video-container iframe {
    transform: scale(1.02);
    transform-origin: center;
}

/* Additional security - block any YouTube overlay elements */
.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background: transparent;
    z-index: 25;
    pointer-events: all;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    color: white;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn i {
    width: 20px;
    height: 20px;
}

.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #b02a37);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Mobile adjustments for controls */
@media (max-width: 768px) {
    .custom-video-controls {
        padding: 15px 12px 12px 12px;
        gap: 12px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .control-btn i {
        width: 16px;
        height: 16px;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .progress-handle {
        width: 20px;
        height: 20px;
    }
    
    .time-display {
        font-size: 11px;
    }
}

/* ============================================================================
   PERFORMANCE OPTIMIZATIONS - 2025
   ============================================================================ */

/* GPU acceleration for better performance */
.video-card,
.video-modal,
.loading-fade,
.play-overlay,
.video-thumbnail {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* Optimized animations with hardware acceleration */
@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: cardSlideIn 0.4s ease-out forwards;
    animation-delay: var(--animation-delay, 0s);
}

/* Smooth image loading animations */
.video-card img {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    background: linear-gradient(45deg, #f5f5f5, #e0e0e0);
    background-size: 400% 400%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.video-card img.loaded {
    opacity: 1;
    animation: none;
}

.video-card img.error {
    opacity: 0.7;
    animation: none;
}

/* Shimmer loading animation */
@keyframes shimmer {
    0% {
        background-position: 100% 0%;
    }
    100% {
        background-position: -100% 0%;
    }
}

/* Performance optimized video grid */
.videos-grid {
    contain: layout style paint;
    transform: translateZ(0);
}

/* Optimized hover effects with better performance */
.video-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Loading states with better visual feedback */
.loading-fade {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Optimized modal animations */
.video-modal.active {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Optimized scroll performance */
.videos-grid {
    overflow-anchor: auto;
    overscroll-behavior: contain;
}

/* Better text rendering performance */
.video-title,
.video-description {
    text-rendering: optimizeSpeed;
    font-feature-settings: "kern" 1;
}

/* Reduce layout thrashing during animations */
.category-btn.active {
    contain: layout style;
}

/* Memory optimization for large video lists */
.video-card:not(.visible) {
    content-visibility: auto;
    contain-intrinsic-size: 320px 280px;
}

/* Performance hints for modern browsers */
.video-thumbnail img[data-src] {
    content-visibility: auto;
    contain-intrinsic-size: 320px 180px;
}