:root {
    /* Core Colors */
    --bg-body: #0f0f12;
    --bg-surface: #18181b;
    --bg-glass: rgba(24, 24, 27, 0.7);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    --accent: #8b5cf6;

    /* Text */
    --text-main: #ffffff;
    --text-muted: #a1a1aa;

    /* UI Elements */
    --border-color: rgba(255, 255, 255, 0.08);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    z-index: 1040;
    transition: transform 0.4s var(--ease-out);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Main Content */
.main-wrapper {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.4s var(--ease-out);
    padding: 20px 40px;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 30px;
}

.search-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 16px 24px 16px 50px;
    color: white;
    width: 100%;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Tags */
.tag-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.tag-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    margin: 0 4px 8px 0;
    user-select: none;
}

.tag-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.tag-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tag-count {
    font-size: 0.7em;
    opacity: 0.6;
    margin-left: 6px;
}

/* Video Cards */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.video-card {
    background: transparent;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s var(--ease-out);
}

.video-card:hover {
    transform: translateY(-5px);
    z-index: 10;
}

.card-thumb-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #202020;
}

.card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.video-card:hover .card-thumb {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

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

.card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease 0.1s;
}

.video-card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.card-actions-bottom {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
    z-index: 20;
}

.video-card:hover .card-actions-bottom {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: white;
    color: black;
    transform: scale(1.1);
}

.action-btn.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.card-info {
    padding: 16px 4px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-main);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.mini-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        padding: 20px;
    }

    .mobile-nav {
        display: flex !important;
    }
}

.mobile-nav {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid var(--border-color);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1060;
}

.custom-toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s var(--ease-out);
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Mobile Optimizations */
@media (max-width: 991px) {
    .video-card:hover {
        transform: none;
    }

    .card-thumb {
        transform: none !important;
    }

    .card-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    }

    .card-actions {
        opacity: 1;
        transform: translateY(0);
    }

    .action-btn {
        width: 42px;
        height: 42px;
        background: rgba(0, 0, 0, 0.6);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .video-grid {
        gap: 16px;
        grid-template-columns: repeat(2, 1fr);
    }

    .card-title {
        font-size: 0.95rem;
    }

    .main-wrapper {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s var(--ease-out);
    z-index: 1050;
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.back-to-top:active {
    transform: scale(0.95);
}

.scroll-sentinel {
    width: 100%;
    height: 1px;
}
