/* Enhanced Mobile-First Video Platform CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Enhanced Color Palette */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1419;
    --bg-tertiary: #161b22;
    --bg-card: #1c2128;
    --bg-hover: #21262d;
    --bg-overlay: rgba(10, 14, 26, 0.95);
    
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-inverse: #0d1117;
    
    --accent-primary: #2ea043;
    --accent-secondary: #1f6feb;
    --accent-tertiary: #8957e5;
    --accent-danger: #da3633;
    --accent-warning: #fb8500;
    --accent-success: #2ea043;
    
    --border-default: #30363d;
    --border-muted: #21262d;
    --border-accent: rgba(31, 111, 235, 0.3);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.35);
    
    --gradient-primary: linear-gradient(135deg, #1f6feb 0%, #8957e5 100%);
    --gradient-secondary: linear-gradient(135deg, #2ea043 0%, #1f6feb 100%);
    --gradient-hero: linear-gradient(135deg, #0a0e1a 0%, #161b22 50%, #1c2128 100%);
    --gradient-card: linear-gradient(145deg, #1c2128 0%, #161b22 100%);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: 14px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: rgba(31, 111, 235, 0.3);
    color: var(--text-primary);
}

/* Authentication Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(31, 111, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(137, 87, 229, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.auth-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(16px);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
    background: var(--bg-card);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Only show validation styles after user interaction */
.form-group input:not(:placeholder-shown):invalid {
    border-color: var(--accent-secondary);
}

.form-group input:not(:placeholder-shown):valid {
    border-color: var(--accent-success);
}

/* Alternative: Only show validation after blur (when user leaves the field) */
.form-group input.touched:invalid {
    border-color: var(--accent-danger);
}

.form-group input.touched:valid {
    border-color: var(--accent-success);
}

/* Show validation only when form has been submitted and failed */
.form-submitted .form-group input:invalid {
    border-color: var(--accent-secondary);
}

.form-submitted .form-group input:valid {
    border-color: var(--accent-success);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.auth-link {
    text-align: center;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-link a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.auth-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-secondary);
    transition: width var(--transition-fast);
}

.auth-link a:hover {
    color: var(--accent-primary);
}

.auth-link a:hover::after {
    width: 100%;
    background: var(--accent-primary);
}

.error-message {
    background: rgba(218, 54, 51, 0.1);
    border: 1px solid var(--accent-danger);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
    color: #ff6b6b;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    position: relative;
    overflow: hidden;
}

.error-message::before {
    content: '⚠️';
    margin-right: 0.5rem;
    font-size: 1rem;
}

.error-message.show {
    display: block;
    animation: errorSlide 0.3s ease-out;
}

@keyframes errorSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid var(--accent-success);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
    color: #4ade80;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    position: relative;
}

.success-message::before {
    content: '✅';
    margin-right: 0.5rem;
    font-size: 1rem;
}

.success-message.show {
    display: block;
    animation: successSlide 0.3s ease-out;
}

@keyframes successSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Referral Info Banner (for register page) */
#referralInfo {
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid var(--accent-success);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--accent-success);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    display: none;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced Navigation */
.navbar {
    background: var(--bg-overlay);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-default);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: var(--bg-overlay);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(31, 111, 235, 0.3));
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#authButtons {
    display: flex;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 50px;
    border: 1px solid var(--border-default);
    transition: all var(--transition-normal);
}

.user-info:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.points {
    font-size: 0.7rem;
    color: var(--accent-secondary);
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 36px;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-secondary);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--accent-secondary);
    border: 2px solid var(--accent-secondary);
}

.btn-outline:hover {
    background: var(--accent-secondary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    min-height: 28px;
}

.btn-full {
    width: 100%;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-hero);
    padding: 2rem 1rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(31, 111, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(137, 87, 229, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Section */
.filter-section {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    padding: 1rem;
    position: sticky;
    top: 73px;
    z-index: 900;
    backdrop-filter: blur(8px);
}

.filter-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-bar {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.search-btn:hover {
    color: var(--accent-secondary);
    background: var(--bg-hover);
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.filter-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    gap: 0.125rem;
    border: 1px solid var(--border-default);
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.filter-tab:not(.active):hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-dropdown,
.sort-dropdown {
    position: relative;
}

.category-select,
.sort-select {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    min-width: 120px;
    transition: all var(--transition-fast);
}

.category-select:focus,
.sort-select:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

/* Videos Section */
.videos-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    border: 1px solid var(--border-default);
}

.view-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active {
    background: var(--accent-secondary);
    color: white;
}

.view-btn:not(.active):hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Enhanced Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    transition: all var(--transition-normal);
}

.video-grid.list-view {
    gap: 0.75rem;
}

.video-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-default);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    opacity: 0;
    animation: slideInUp 0.6s ease forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.video-card.animate-in {
    animation: slideInUp 0.6s ease forwards;
}

.list-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.list-card .video-thumbnail-container {
    width: 160px;
    flex-shrink: 0;
}

.list-card .video-thumbnail {
    height: 90px;
}

.list-card .video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-thumbnail-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.list-card .video-thumbnail-container {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.video-card:hover .video-thumbnail {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-normal);
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.play-btn:hover {
    background: white;
    transform: scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-icon {
    background: var(--accent-warning);
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.video-info {
    padding: 1rem;
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.video-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.video-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.video-category {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-category.entertainment { background: linear-gradient(135deg, #8b5cf6, #a855f7); color: white; }
.video-category.education { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.video-category.tech { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; }
.video-category.gaming { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.video-category.lifestyle { background: linear-gradient(135deg, #ec4899, #db2777); color: white; }

.video-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.meta-right {
    flex-shrink: 0;
}

.premium-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.free-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn.liked {
    color: #ff6b6b;
}

/* Loading States */
.loading-skeleton {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-default);
}

.skeleton-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 1rem;
}

.skeleton-title {
    height: 1rem;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.skeleton-meta {
    height: 0.75rem;
    width: 60%;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Empty/Error States */
.empty-state,
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
}

.empty-icon,
.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-title,
.error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-subtitle,
.error-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

/* Context Menu */
.video-context-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 160px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-muted);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--bg-hover);
}

/* Enhanced Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: 1rem;
}

.modal[style*="flex"] {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal[style*="flex"] .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close {
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.125rem;
}

.close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 0 1.5rem 1.5rem;
}

.referral-link {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
}

.referral-link input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: 'Monaco', monospace;
    font-size: 0.8rem;
}

.points-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.points-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.points-value {
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Login Prompt Modal */
.login-prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: all var(--transition-normal);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
}

.login-prompt-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.prompt-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    position: relative;
}

.prompt-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.prompt-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.close-prompt {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.close-prompt:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.prompt-body {
    padding: 0 2rem 1rem;
}

.video-preview {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.preview-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.preview-info {
    flex: 1;
}

.preview-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.benefits {
    margin: 1rem 0;
}

.benefit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.benefit-icon {
    font-size: 1rem;
}

.prompt-actions {
    padding: 1rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* FAB (Floating Action Button) */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.fab-container.visible {
    opacity: 1;
    visibility: visible;
}

.fab {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.fab.active {
    transform: rotate(45deg);
}

.fab-menu {
    position: absolute;
    bottom: 4rem;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.fab-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-item:hover {
    background: var(--accent-secondary);
    color: white;
    transform: scale(1.1);
}

/* Notifications */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transform: translateY(-100%);
    transition: all var(--transition-normal);
    backdrop-filter: blur(12px);
}

.notification.show {
    transform: translateY(0);
}

.notification.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.notification-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-success { border-left: 4px solid var(--accent-success); }
.notification-error { border-left: 4px solid var(--accent-danger); }
.notification-warning { border-left: 4px solid var(--accent-warning); }
.notification-info { border-left: 4px solid var(--accent-secondary); }

/* Enhanced Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-default);
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.footer-bottom {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-muted);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }

    .nav-container {
        padding: 0 2rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .user-info {
        flex-direction: row;
        gap: 1rem;
        padding: 0.75rem 1.25rem;
    }

    .username {
        font-size: 0.9rem;
        max-width: none;
    }

    .points {
        font-size: 0.8rem;
    }

    .user-actions {
        flex-direction: row;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-height: 40px;
    }

    .auth-card {
        padding: 3rem;
        max-width: 480px;
    }

    .auth-card h2 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 3rem 2rem 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .filter-section {
        top: 81px;
    }

    .filter-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .filter-controls {
        flex-direction: row;
        gap: 1rem;
    }

    .search-bar {
        margin: 0;
    }

    .videos-section {
        padding: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .video-grid.list-view {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .video-thumbnail {
        height: 200px;
    }

    .video-title {
        font-size: 1.1rem;
    }

    .loading-skeleton {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .notification {
        right: 2rem;
        left: auto;
        max-width: 400px;
    }

    .fab-container {
        right: 2rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        padding: 3rem 2rem 2rem;
    }

    .footer-bottom {
        grid-column: 1 / -1;
    }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    .navbar {
        padding: 1rem 0;
    }

    .logo {
        font-size: 1.75rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .auth-card {
        padding: 3.5rem;
        max-width: 520px;
    }

    .auth-card h2 {
        font-size: 2.25rem;
    }

    .hero-section {
        padding: 4rem 2rem 3rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-stats {
        gap: 3rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .filter-section {
        top: 89px;
        padding: 1.5rem 2rem;
    }

    .videos-section {
        padding: 3rem 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 2rem;
    }

    .video-thumbnail {
        height: 220px;
    }

    .video-title {
        font-size: 1.2rem;
    }

    .video-card:hover {
        transform: translateY(-6px);
    }

    .loading-skeleton {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        padding: 4rem 2rem 2rem;
    }
}

/* Large Desktop */
@media (min-width: 1440px) {
    .hero-section {
        padding: 5rem 2rem 4rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .videos-section {
        padding: 4rem 2rem;
    }

    .section-title {
        font-size: 2.25rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 2.5rem;
    }

    .video-card:hover {
        transform: translateY(-8px);
    }
}

/* High-DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .video-thumbnail {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-default: #ffffff;
        --text-secondary: #ffffff;
        --bg-secondary: #000000;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.search-input:focus,
.category-select:focus,
.sort-select:focus,
.video-card:focus,
.form-group input:focus {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .navbar,
    .filter-section,
    .fab-container,
    .modal,
    footer {
        display: none !important;
    }

    .video-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }

    .video-thumbnail {
        height: auto;
        max-height: 150px;
    }

    .auth-container {
        background: white;
        color: black;
    }

    .auth-card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .form-group input {
        min-height: 44px;
        padding: 0.875rem 1rem;
    }

    .video-card:hover {
        transform: none;
    }

    .video-overlay {
        opacity: 1;
    }

    .fab {
        width: 64px;
        height: 64px;
    }

    .fab-item {
        width: 56px;
        height: 56px;
    }
}

/* Landscape Phone Optimizations */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .auth-card h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .hero-section {
        padding: 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .filter-section {
        padding: 0.75rem 1rem;
    }

    .videos-section {
        padding: 1rem;
    }
}

content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}