:root {
    --vt-primary: #6366f1;
    --vt-secondary: #4f46e5;
    --vt-accent: #f59e0b;
    --vt-bg: #f8fafc;
    --vt-card-bg: #ffffff;
    --vt-text-main: #1e293b;
    --vt-text-muted: #64748b;
}

.vt-wrapper {
    background: var(--vt-bg);
    min-height: 100vh;
    padding-bottom: 50px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Premium Hero Section */
.vt-hero {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 80px 0;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.vt-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: rotateBg 20s linear infinite;
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.vt-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    letter-spacing: -1px;
}

.vt-hero p {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Layout */
.vt-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

.vt-main {
    min-width: 0;
    /* Critical for grid children with horizontal scroll */
    max-width: 100%;
}

/* Sidebar Redesign */
.vt-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    z-index: 10;
}

.vt-widget {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.vt-widget h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--vt-text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Search Box in Sidebar */
.vt-search-form {
    position: relative;
}

.vt-search-input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 45px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

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

.vt-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--vt-text-muted);
    font-size: 1.2rem;
}

/* Category List */
.vt-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vt-cat-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--vt-text-main);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    font-weight: 500;
}

.vt-cat-item a:hover,
.vt-cat-item.active a {
    background: #f1f5f9;
    color: var(--vt-primary);
}

.vt-cat-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

/* Video Grid */
.vt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Video Card Premium */
.vt-card {
    background: var(--vt-card-bg);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    position: relative;
}

.vt-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.vt-thumb-wrap {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 */
    overflow: hidden;
}

.vt-thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.vt-card:hover .vt-thumb-wrap img {
    transform: scale(1.1);
}

.vt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--vt-primary);
    font-size: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.vt-card:hover .vt-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.vt-card-content {
    padding: 20px;
}

.vt-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vt-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--vt-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.vt-hit {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--vt-text-muted);
}

.vt-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    color: var(--vt-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vt-title a {
    color: inherit;
    text-decoration: none;
}

/* Pagination */
.vt-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.vt-page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: var(--vt-text-main);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.vt-page-link.active {
    background: var(--vt-primary);
    color: #fff;
    border-color: var(--vt-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vt-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .vt-hero h1 {
        font-size: 2rem;
    }

    .vt-hero {
        padding: 40px 20px;
    }

    .vt-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vt-hero::before {
        animation: none;
    }

    .vt-card,
    .vt-card:hover,
    .vt-thumb-wrap img,
    .vt-card:hover .vt-thumb-wrap img,
    .vt-play-btn,
    .vt-card:hover .vt-play-btn {
        transition: none;
        transform: none;
    }
}

.vt-excerpt {
    margin: 8px 0 0;
    color: var(--vt-text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vt-duration {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--vt-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Videotube Detail */
.vd-body {
    background: var(--vt-bg);
    padding: 15px 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.vd-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: flex-start;
}

.vd-main-content {
    background: var(--vt-card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.vd-player-wrap {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.vd-player-wrap iframe,
.vd-player-wrap #yt-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vd-details {
    padding: 10px;
}

.vd-category-tag {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--vt-primary);
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 15px;
    text-decoration: none;
}

.vd-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--vt-text-main);
    margin-bottom: 20px;
    line-height: 1.3;
}

.vd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--vt-text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.vd-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vd-description {
    line-height: 1.7;
    color: #475569;
}

.vd-description h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--vt-text-main);
}

.vd-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    z-index: 10;
}

.vd-widget {
    background: var(--vt-card-bg);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    margin-bottom: 25px;
}

.vd-widget h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vd-widget-muted {
    color: var(--vt-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.vd-similar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vd-similar-card {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.vd-similar-card:hover {
    transform: translateX(5px);
}

.vd-similar-thumb {
    width: 120px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.vd-similar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vd-similar-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vd-similar-meta {
    font-size: 0.75rem;
    color: var(--vt-text-muted);
}

.vd-tag-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.vd-tag-item:hover {
    border-color: var(--vt-primary);
    color: var(--vt-primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
}

.vd-search-form {
    position: relative;
}

.vd-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
}

.vd-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: var(--vt-primary);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vd-search-btn:hover {
    background: var(--vt-secondary);
    transform: translateY(-50%) scale(1.05);
}


.vd-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.vd-overlay-content {
    text-align: center;
    color: #fff;
}

.vd-overlay-play {
    font-size: 50px;
    background: var(--vt-primary);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 15px;
    padding-left: 5px;
}

.vd-missing {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vt-text-muted);
    font-weight: 600;
    font-size: 1rem;
    background: #0f172a;
    border-radius: 20px;
    text-align: center;
}

@media (max-width: 1024px) {
    .vd-layout {
        grid-template-columns: 1fr;
    }

    .vd-sidebar {
        position: relative;
        top: 0;
    }
}

/* Video Comments Section Styling */
.vd-comments-section {
    margin-bottom: 50px;
}

.vd-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--vt-text-main);
    position: relative;
    padding-left: 20px;
    margin-bottom: 30px !important;
}

.vd-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 26px;
    background: linear-gradient(to bottom, var(--vt-primary), var(--vt-secondary));
    border-radius: 10px;
}

.vd-form-control {
    border: 2px solid #eef2f6 !important;
    border-radius: 16px !important;
    padding: 15px 20px !important;
    font-size: 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-color: #fcfdfe !important;
}

.vd-form-control:focus {
    border-color: var(--vt-primary) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.1) !important;
}

.vd-submit-btn {
    background: linear-gradient(135deg, var(--vt-primary) 0%, var(--vt-secondary) 100%);
    color: #fff;
    border: none;
    padding: 16px 36px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.vd-submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.vd-submit-btn:active {
    transform: translateY(-1px);
}

.vd-comment-item {
    background: #fff !important;
    border: 1px solid #f1f5f9;
    padding: 24px !important;
    border-radius: 20px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px !important;
}

.vd-comment-item:hover {
    transform: translateX(8px);
    border-color: var(--vt-primary);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.08) !important;
}

.vd-comment-avatar img {
    border: 4px solid #fff;
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.vd-comment-item:hover .vd-comment-avatar img {
    transform: scale(1.1);
}

.vd-comment-content h6 {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vd-comment-date {
    font-size: 0.8rem;
    color: var(--vt-text-muted);
    font-weight: 500;
}

.vd-comment-text {
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-top: 8px;
}

.vd-comment-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 16px;
    color: var(--vt-text-muted);
    border: 2px dashed #e2e8f0;
}

.vd-comment-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Drawer Styles */
.vt-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 10001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.vt-drawer.active {
    left: 0;
}

.vt-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.vt-drawer-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--vt-text-main);
}

.vt-drawer-close {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.vt-drawer-close:hover {
    background: #e2e8f0;
    color: #ef4444;
}

.vt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.vt-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Filter Bar */
.vt-filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vt-filter-bar::-webkit-scrollbar {
    display: none;
}

.vt-drawer-trigger {
    background: var(--vt-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.vt-drawer-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.3);
}

.vt-filter-pill {
    padding: 8px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    color: var(--vt-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.vt-filter-pill:hover,
.vt-filter-pill.active {
    background: #f1f5f9;
    color: var(--vt-primary);
    border-color: var(--vt-primary);
}

/* Fix sidebar visibility on smaller screens if we use drawer */
@media (max-width: 991px) {
    .vt-sidebar {
        display: none;
    }

    .vt-container {
        grid-template-columns: 1fr;
    }
}

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

.vd-toast-msg {
    min-width: 240px;
    max-width: min(420px, calc(100vw - 40px));
    background: #ffffff;
    color: #1f2937;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
    pointer-events: auto;
    animation: vdToastIn 0.22s ease-out;
}

.vd-toast-msg.vd-toast-warning {
    border-left-color: #f59e0b;
}

.vd-toast-msg.vd-toast-error {
    border-left-color: #ef4444;
}

.vd-toast-msg.is-hiding {
    animation: vdToastOut 0.28s ease forwards;
}

@keyframes vdToastIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

@keyframes vdToastOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}
