@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Modern Color Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-hover: #f0f0f0;
    --bg-active: #e8e8e8;

    --text-primary: #0a0a0a;
    --text-secondary: #606060;
    --text-tertiary: #909090;
    --text-inverse: #ffffff;

    --accent-primary: #ff0033;
    --accent-hover: #e6002e;
    --accent-light: #fff0f3;

    --border-light: #e0e0e0;
    --border-medium: #d0d0d0;
    --border-dark: #a0a0a0;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --header-height: 60px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 72px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background-color: var(--accent-light);
    color: var(--accent-primary);
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Header - Enhanced */
/* header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    backdrop-filter: blur(20px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
} */

.menu-icon {
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.menu-icon:hover {
    background-color: var(--bg-hover);
    transform: scale(1.05);
}

.menu-icon:active {
    transform: scale(0.95);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    user-select: none;
}

.logo-icon {
    color: var(--accent-primary);
    font-size: 32px;
    transition: transform var(--transition-base);
}

.logo:hover .logo-icon {
    transform: rotate(-15deg) scale(1.1);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 720px;
    margin: 0 40px;
}

.search-bar {
    display: flex;
    width: 100%;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0 20px;
    background-color: var(--bg-secondary);
    border: 1.5px solid var(--border-light);
    border-right: none;
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    height: 44px;
    transition: all var(--transition-base);
}

.search-bar input:focus {
    outline: none;
    border-color: #1c62b9;
}

.search-bar button {
    width: 64px;
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 0 40px 40px 0;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar button:hover {
    background-color: var(--bg-hover);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: transparent;
    color: #3ea6ff;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.login-btn:hover {
    background-color: #263850;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    background-color: #555;
    object-fit: cover;
}

/* User Dropdown */
.user-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.upload-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    color: var(--text-primary);
    transition: background 0.2s;
}

.upload-btn:hover {
    background-color: var(--bg-hover);
}

.upload-btn i {
    font-size: 24px;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background-color: #ffffff;
    border-radius: 8px;
    width: 280px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.user-dropdown-menu.active {
    display: flex;
}

/* Notifications UI */
.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #cc0000;
    color: white;
    font-size: 10px;
    padding: 0 4px;
    border-radius: 10px;
    border: 2px solid #ffffff;
    font-weight: 500;
    min-width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    pointer-events: none;
}

.notif-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background-color: #ffffff;
    border-radius: 8px;
    width: 480px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}

.notif-menu.active {
    display: flex;
}

/* Fix mobile dropdown alignment and clipping */
@media (max-width: 640px) {

    #notif-menu,
    #user-dropdown-menu {
        position: fixed !important;
        top: 56px !important;
        /* Header height */
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 4px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    }
}

.notif-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.notif-list {
    overflow-y: auto;
}

.notif-item {
    display: flex;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    align-items: flex-start;
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item.unread {
    background: rgba(62, 166, 255, 0.05);
}

.notif-item.unread::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #3ea6ff;
    border-radius: 50%;
    margin-top: 20px;
}

.notif-content {
    flex: 1;
}

.notif-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notif-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropdown-user-info {
    display: flex;
    padding: 16px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.dropdown-user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    justify-content: center;
}

.dropdown-user-name {
    font-weight: 500;
    font-size: 16px;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.dropdown-user-handle {
    font-size: 14px;
    color: var(--text-secondary);
}

.dropdown-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
}

.dropdown-item i {
    font-size: 24px;
    color: var(--text-primary);
}


/* Layout */
.main-container {
    display: flex;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    padding: 12px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    gap: 24px;
    color: var(--text-primary);
    font-size: 14px;
}

.sidebar-item:hover {
    background-color: var(--bg-hover);
}

.sidebar-item.active {
    background-color: var(--bg-hover);
    font-weight: 500;
}

.sidebar-item i {
    font-size: 24px;
    width: 24px;
}

/* Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    row-gap: 40px;
}

.video-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    background-color: #e5e5e5;
    overflow: hidden;
    position: relative;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.video-card:hover .thumbnail img {
    transform: scale(1.05);
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.video-info {
    display: flex;
    margin-top: 12px;
    gap: 12px;
}

.creator-avatar-small,
.creator-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ddd;
    flex-shrink: 0;
}

.video-details {
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.creator-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.video-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.creator-name:hover {
    color: var(--text-primary);
}

/* Video Action Menu */
.video-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.video-options-btn {
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    position: relative;
}

.video-options-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.video-options-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 100;
    width: 150px;
}

.video-options-menu.active {
    display: flex;
}

.video-options-item {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-primary);
}

.video-options-item:hover {
    background: var(--bg-hover);
}

.video-options-item i {
    font-size: 20px;
}

.video-options-item.delete {
    color: #ff4e4e;
}

.video-options-item.delete i {
    color: #ff4e4e;
}

.video-options-item.delete:hover {
    background: #401010;
}

/* Hidden Video Styles */
.video-card.video-hidden {
    opacity: 0.8;
}

.hidden-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #aaa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.hidden-label i {
    font-size: 14px;
}


/* Auth Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    width: 400px;
}

.modal-header {
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: bold;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    background: #f9f9f9;
    border: 1px solid var(--border);
}

.auth-user-item:hover {
    background: #f0f0f0;
}

/* Video Player Page Styles */
/* Responsive Layouts */
@media (max-width: 1024px) {
    .secondary-column {
        width: 100% !important;
    }
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: black;
    position: relative;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
}

.actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.actions-left,
.actions-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #272727;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.action-btn:hover {
    background: #3f3f3f;
}

/* Auth Pages (Login/Register) */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--bg-primary);
}

.auth-box {
    background-color: var(--bg-secondary);
    padding: 48px;
    border-radius: 8px;
    width: 450px;
    border: 1px solid var(--border);
    text-align: center;
}

.auth-logo {
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: bold;
}

.auth-title {
    font-size: 24px;
    margin-bottom: 16px;
    font-weight: 500;
}

.auth-subtitle {
    margin-bottom: 32px;
    color: var(--text-secondary);
}

.auth-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 16px;
}

.auth-input:focus {
    border-color: #3ea6ff;
    outline: none;
}

.auth-action-btn {
    width: 100%;
    padding: 12px;
    background: #3ea6ff;
    color: black;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
}

.auth-action-btn:hover {
    background: #65b8ff;
}

.auth-footer {
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer a {
    color: #3ea6ff;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #212121;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-size: 14px;
    min-width: 250px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border-left: 4px solid #3ea6ff;
}

.toast.toast-error {
    border-left-color: #ff4e4e;
}

.toast.toast-success {
    border-left-color: #2ba640;
}

.toast.fade-out {
    animation: toastFadeOut 0.3s forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-20px);
        opacity: 0;
    }
}

/* Custom Confirm Modal */
#custom-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

#custom-confirm-modal {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: #0f0f0f;
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

#custom-confirm-overlay.active #custom-confirm-modal {
    transform: scale(1);
}

.confirm-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 14px;
    color: #606060;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-btn-cancel {
    background: transparent;
    border: none;
    color: #0f0f0f;
}

.confirm-btn-cancel:hover {
    background: #f2f2f2;
}

.confirm-btn-confirm {
    background: #cc0000;
    color: white;
    border: none;
}

.confirm-btn-confirm:hover {
    background: #990000;
}

.confirm-btn-confirm.blue {
    background: #065fd4;
}

.confirm-btn-confirm.blue:hover {
    background: #0556bf;
}