:root {
    --bg-color: #0d0f14;
    --panel-bg: rgba(26, 30, 41, 0.6);
    --panel-border: rgba(255, 255, 255, 0.1);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --gradient-1: #818cf8;
    --gradient-2: #c084fc;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Panel Utility */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* View Toggling */
.view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    min-height: 100vh;
}

.view.active {
    display: flex;
    opacity: 1;
}

/* --- Login View --- */
#login-view {
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.background-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 30%, transparent 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.login-container .logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-container h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* --- Dashboard View --- */
#dashboard-view {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 12px;
}

.dashboard-header .logo {
    font-size: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.dashboard-layout {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

#platform-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.platform-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.platform-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.platform-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.feed-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
}

.feed-header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.feed-header p {
    color: var(--text-secondary);
}

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

.video-card {
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(45deg, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.play-button {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s, transform 0.2s;
}

.video-card:hover .play-button {
    background: var(--primary-color);
    transform: scale(1.1);
}

.video-info {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
}

.badge.live {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 1rem;
    }
    
    #platform-list {
        flex-direction: row;
    }
    
    .sidebar h3 {
        display: none;
    }
    
    .platform-item.active {
        border-left: none;
        border-bottom: 3px solid var(--primary-color);
    }
}
