/* Levi Live - The Future of Live Streaming */
:root {
    /* Deep Space Color Palette */
    --color-deep-space: #0B0E14;
    --color-dark-void: #0A0D12;
    --color-space-gray: #1A1F2E;
    --color-neon-blue: #00D4FF;
    --color-cyan: #00E5FF;
    --color-electric-violet: #8B5CF6;
    --color-glow-blue: rgba(0, 212, 255, 0.3);
    --color-glow-violet: rgba(139, 92, 246, 0.3);
    
    /* Glassmorphism */
    --glass-bg: rgba(15, 20, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    
    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--color-deep-space);
    color: var(--text-primary);
    position: fixed;
    touch-action: pan-y;
}

/* Animated Background Canvas */
.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Main App Container */
.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    z-index: 1;
    display: flex;
    overflow: hidden;
}

/* Feed HUD (Left Sidebar) */
.feed-hud {
    position: fixed;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    pointer-events: none;
}

.hud-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.hud-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.8;
}

.hud-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-neon-blue);
    text-shadow: 0 0 15px var(--color-glow-blue), 0 0 30px rgba(0, 212, 255, 0.3);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.hud-bar {
    width: 4px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.hud-bar-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--color-neon-blue), var(--color-cyan));
    box-shadow: 0 0 10px var(--color-glow-blue);
    transition: height 0.3s ease;
    border-radius: 2px;
}

/* Central Scale Bar */
.central-scale-bar {
    position: fixed;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 100vh;
    background: rgba(26, 31, 46, 0.6);
    backdrop-filter: blur(10px);
    z-index: 5;
    pointer-events: none;
    border-left: 1px solid rgba(0, 212, 255, 0.1);
    border-right: 1px solid rgba(0, 212, 255, 0.1);
}

.scale-mark {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 212, 255, 0.2);
    width: 100%;
}

.scale-mark:nth-child(5n) {
    background: rgba(0, 212, 255, 0.4);
    height: 2px;
}

/* Main Feed Container */
.feed-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin-left: 120px;
    margin-right: 120px;
}

.feed-scroll-area {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--spacing-lg) var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    align-items: center;
}

.feed-scroll-area::-webkit-scrollbar {
    display: none;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    height: 100%;
    color: var(--text-secondary);
}

.loading-orb {
    width: 60px;
    height: 60px;
    border: 2px solid var(--color-neon-blue);
    border-radius: 50%;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.loading-orb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--color-neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--color-glow-blue);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

.loading-text {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.6;
}

/* Live Card */
.live-card {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.live-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 16px 48px rgba(0, 212, 255, 0.2),
                0 0 0 1px rgba(0, 212, 255, 0.1);
}

.live-card.focused {
    transform: scale(1.05) translateY(-12px);
    z-index: 100;
}

.live-card.focused::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    pointer-events: none;
}

.card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: var(--spacing-md);
    z-index: 2;
    transform: translateZ(20px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 0, 0.5);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #FF4444;
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #FF4444;
    border-radius: 50%;
    box-shadow: 0 0 10px #FF4444;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 12px;
    color: var(--text-secondary);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* Intelligence Labels */
.intelligence-label {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: 6px 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-neon-blue);
    opacity: 0.8;
    z-index: 3;
    pointer-events: none;
}

/* Floating Action Orb */
.floating-orb {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 64px;
    height: 64px;
    z-index: 1000;
    cursor: pointer;
}

.orb-core {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--color-neon-blue), var(--color-cyan));
    border-radius: 50%;
    box-shadow: 0 0 30px var(--color-glow-blue),
                0 0 60px rgba(0, 212, 255, 0.3);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.orb-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-neon-blue);
    border-radius: 50%;
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.floating-orb.active .orb-core {
    transform: scale(1.1);
    box-shadow: 0 0 40px var(--color-glow-blue),
                0 0 80px rgba(0, 212, 255, 0.5);
}

/* Radial Menu */
.radial-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform-origin: bottom right;
}

.floating-orb.active .radial-menu {
    width: 280px;
    height: 280px;
    opacity: 1;
    pointer-events: all;
}

.radial-item {
    position: absolute;
    width: 56px;
    height: 56px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    color: var(--text-primary);
    box-shadow: 0 4px 16px var(--glass-shadow);
}

.radial-item:hover {
    transform: scale(1.1);
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--color-neon-blue);
    box-shadow: 0 0 20px var(--color-glow-blue);
}

.radial-item svg {
    width: 24px;
    height: 24px;
}

.radial-label {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.radial-item:hover .radial-label {
    opacity: 1;
}

/* Position Radial Items */
.radial-item:nth-child(1) {
    top: 0;
    right: 112px;
}

.radial-item:nth-child(2) {
    top: 112px;
    right: 0;
}

.radial-item:nth-child(3) {
    bottom: 0;
    right: 112px;
}

.radial-item:nth-child(4) {
    top: 112px;
    right: 224px;
}

/* Feed Intelligence Overlay */
.feed-intelligence {
    position: fixed;
    top: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .feed-container {
        margin-left: 0;
        margin-right: 0;
    }
    
    .feed-hud {
        display: none;
    }
    
    .floating-orb {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 56px;
        height: 56px;
    }
    
    .live-card {
        max-width: 100%;
    }
}

/* Performance Optimizations */
.live-card,
.radial-item,
.orb-core {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.card-thumbnail {
    will-change: opacity;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU Acceleration */
.feed-scroll-area {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.live-card {
    contain: layout style paint;
}

/* Smooth Scrolling */
.feed-scroll-area {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
