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

/* VideoJS Player Styles */
.video-js {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.video-grid .video-js {
    height: 200px;
}

.video-card .video-js {
    height: 200px;
}

/* Improve rendering performance for large grids */
.video-card {
    content-visibility: auto;
    contain-intrinsic-size: 225px 400px; /* approximate height x width to reserve space */
}

.related-video-item {
    content-visibility: auto;
    contain-intrinsic-size: 90px 160px;
}

.video-player-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.video-placeholder {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #6c757d;
    font-size: 0.9rem;
}

.video-player {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.videos-grid .video-player {
    height: 200px;
}


body {
    font-family: "Roboto", "Arial", sans-serif;
    line-height: 1.4;
    color: #0f0f0f;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0 24px;
    max-width: none;
}

/* YouTube-style Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    flex-wrap: nowrap;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 16px;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: #606060;
    font-weight: bold;
}

.hamburger-menu:hover {
    background: #f2f2f2;
}


.logo {
    font-size: 20px;
    font-weight: 600;
    color: #ff0000;
    letter-spacing: -1.5px;
}

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

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    max-width: 580px;
    width: 40%;
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 640px;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 40px 0 0 40px;
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #065fd4;
}

.search-btn {
    width: 64px;
    height: 40px;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 40px 40px 0;
    background: #f8f8f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #f0f0f0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
}

.create-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 18px;
    text-decoration: none;
    color: #065fd4;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.create-btn:hover {
    background: #f8f8f8;
}

.user-dropdown {
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #065fd4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.user-menu.show {
    display: block;
}

.user-menu a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #0f0f0f;
    font-size: 14px;
}

.user-menu a:hover {
    background: #f8f8f8;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
}

.language-switcher a {
    padding: 4px 8px;
    text-decoration: none;
    color: #606060;
    font-size: 13px;
    border-radius: 4px;
}

.language-switcher a:hover,
.language-switcher a.active {
    background: #f2f2f2;
    color: #0f0f0f;
}

/* Remove extra margin - now handled by header-right gap */

/* YouTube Layout with Sidebar */
.main {
    display: flex;
    margin: 0;
    padding: 0;
}

.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid #e5e5e5;
    padding: 12px 0;
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    overflow-y: auto;
    z-index: 50;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
}

.sidebar-section {
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: #0f0f0f;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.sidebar-item:hover {
    background: #f2f2f2;
}

.sidebar-item.active {
    background: #f2f2f2;
    font-weight: 500;
}

.sidebar-item-icon {
    margin-right: 24px;
    width: 24px;
    text-align: center;
    font-size: 16px;
}

.sidebar-section-title {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #606060;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

/* YouTube-style video grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: visible;
    cursor: pointer;
    position: relative;
}

.video-card:hover {
    /* No transform - just keep it static */
}

.video-thumbnail-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #f0f0f0;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Force browser to use smaller decode size for performance */
    image-rendering: auto;
    transform: translateZ(0);
    will-change: transform;
}

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

.video-info {
    padding: 16px;
}

.video-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.video-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #065fd4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.video-details {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
    color: #0f0f0f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 13px;
    color: #606060;
    margin-bottom: 2px;
}

.video-meta {
    font-size: 13px;
    color: #606060;
}

.video-menu {
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.video-menu:hover {
    background: #f2f2f2;
}

.video-menu span {
    font-size: 20px;
    color: #606060;
    line-height: 1;
    font-weight: bold;
}

.video-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 150px;
    width: max-content;
    display: none;
    z-index: 1000;
    padding: 8px 0;
    overflow: visible;
}

.video-menu-dropdown.show {
    display: block;
}

.menu-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #0f0f0f;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
}

.menu-item:hover {
    background: #f2f2f2;
}

.global-dropdown {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 150px;
    z-index: 10000;
    padding: 8px 0;
}

.hashtag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hashtag-tag {
    color: #065fd4;
    text-decoration: none;
    font-size: 13px;
}

.hashtag-tag:hover {
    text-decoration: underline;
}

/* Responsive YouTube Grid */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .video-grid {
        display: block;
        padding: 16px;
    }
    
    .video-card {
        background: white;
        margin-bottom: 16px;
        border-radius: 0;
        border-bottom: 1px solid #e5e5e5;
        padding-bottom: 16px;
    }
    
    .video-card:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .video-thumbnail-container {
        height: 200px;
        border-radius: 0;
        margin-bottom: 12px;
    }
    
    .video-info {
        padding: 0 16px 16px 16px;
    }
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .header-center {
        display: none;
    }
    
    .create-btn {
        display: none;
    }
}

.lang-link {
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.lang-link:hover {
    color: #007bff;
    border-color: #007bff;
}

.user-info {
    font-size: 0.9rem;
    color: #6c757d;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* Danger and sizing for consistent actions */
.btn-danger {
    background-color: #dc3545;
    color: #fff;
}
.btn-danger:hover {
    background-color: #c82333;
}
.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-full {
    width: 100%;
}

.main {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 0.5rem;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.videos h3 {
    margin-bottom: 2rem;
    color: #333;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    /* No transitions */
    cursor: pointer;
}

/* Removed hover animation */

.video-thumbnail-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.video-card:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(0, 0, 0, 0.9);
}

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

.video-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.video-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.video-stats {
    font-size: 0.9rem;
    color: #495057;
}

.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #007bff;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #6c757d;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.upload-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.upload-progress {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    padding: 16px;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border-left: 4px solid #007bff;
}

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

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.toast-title {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    margin-left: auto;
}

.toast-body {
    color: #666;
    font-size: 14px;
}

/* Simple Drag & Drop Zone */
.drop-zone-simple {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone-simple:hover,
.drop-zone-simple.drag-over {
    border-color: #007bff;
    background: #f0f8ff;
}

.drop-zone-simple input[type="file"] {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

.drop-zone-simple p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.drop-zone-simple.drag-over p {
    color: #007bff;
}

/* Hashtag System Styles */
.hashtag-input-container {
    position: relative;
    margin-bottom: 1rem;
}

.hashtag-display {
    min-height: 40px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.hashtag-tag {
    display: inline-flex;
    align-items: center;
    background: #007bff;
    color: white;
    padding: 4px 8px 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    gap: 6px;
}

.hashtag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.hashtag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hashtag-input {
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
}

.hashtag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.hashtag-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.hashtag-suggestion:last-child {
    border-bottom: none;
}

.hashtag-suggestion:hover,
.hashtag-suggestion.active {
    background: #f8f9fa;
}

.hashtag-name {
    font-weight: 500;
    color: #007bff;
}

.hashtag-count {
    font-size: 0.8rem;
    color: #666;
}

.hashtag-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.hashtag-link:hover {
    text-decoration: underline;
}

.hashtag-list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hashtag-list .hashtag-tag {
    background: #6c757d;
    padding: 3px 8px;
    font-size: 0.8rem;
}

.hashtag-list .hashtag-tag:hover {
    background: #007bff;
}

.hashtag-help {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .hashtag-display {
        min-height: 35px;
        padding: 6px;
        gap: 4px;
    }
    
    .hashtag-tag {
        font-size: 0.8rem;
        padding: 3px 6px 3px 8px;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
}
/* Minimal, consistent modal styles */
#kv-modal-root .kv-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; z-index: 9999; opacity:0; transition: opacity .15s ease; }
#kv-modal-root .kv-modal-overlay.show { opacity:1; }
#kv-modal-root .kv-modal { width: 92%; max-width: 480px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); overflow:hidden; }
#kv-modal-root .kv-modal-header { padding: 12px 16px; font-weight: 600; border-bottom: 1px solid #eee; }
#kv-modal-root .kv-modal-body { padding: 16px; color: #333; }
#kv-modal-root .kv-modal-footer { padding: 12px 16px; border-top: 1px solid #eee; display:flex; gap:8px; justify-content: flex-end; }
#kv-modal-root .kv-btn { padding: 8px 12px; border-radius: 8px; border: 1px solid #ddd; background: #f8f8f8; cursor: pointer; font: inherit; }
#kv-modal-root .kv-btn-primary { background: #0d6efd; border-color: #0d6efd; color: #fff; }
#kv-modal-root .kv-btn-secondary { background: #fff; }
#kv-modal-root .kv-input { width:100%; padding: 8px 10px; border:1px solid #ddd; border-radius: 8px; }
