:root {
    --bg-main: #0a0a0b;
    --bg-card: rgba(20, 20, 22, 0.7);
    --bg-card-hover: rgba(30, 30, 35, 0.9);
    --bg-header: #121214;
    --text-main: #f3f3f4;
    --text-muted: #9ba1a6;
    --accent: #3f63ff;
    --accent-hover: #5b79ff;
    --border: rgba(255, 255, 255, 0.08);
    --error: #ff453a;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ================= LOGIN PAGE ================= */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #1a1a24, var(--bg-main));
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.icon-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background: rgba(63, 99, 255, 0.1);
    color: var(--accent);
    border-radius: 50%;
    margin-bottom: 24px;
}

.logo-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.error-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 69, 58, 0.1);
    color: var(--error);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    border: 1px solid rgba(255, 69, 58, 0.2);
    text-align: left;
}

.input-group {
    text-align: left;
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

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

/* ================= GALLERY PAGE ================= */
.app-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.app-header .logo h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.app-content {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.gallery-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 32px;
    align-items: start;
}

/* Video Player section */
.video-player-container {
    background: var(--bg-header);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none; /* hidden until selected */
}

.player-wrapper video.active {
    display: block;
}

.player-placeholder {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.6);
    display: none;
}

.player-placeholder.active {
    display: flex;
}

.now-playing-info {
    padding: 24px;
}

.now-playing-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

/* Playlist section */
.playlist {
    background: var(--bg-header);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
}

.playlist-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.playlist-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.empty-state {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

.empty-state .muted {
    font-size: 12px;
    opacity: 0.7;
}

.video-list {
    list-style: none;
    overflow-y: auto;
    padding: 12px;
}

/* Custom scrollbar */
.video-list::-webkit-scrollbar {
    width: 6px;
}

.video-list::-webkit-scrollbar-track {
    background: transparent;
}

.video-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.video-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.video-item:hover {
    background: var(--bg-card-hover);
}

.video-item.active {
    background: rgba(63, 99, 255, 0.1);
    border-color: rgba(63, 99, 255, 0.3);
}

.video-item.active .video-icon {
    background: var(--accent);
    color: white;
}

.video-item.active .video-name {
    color: var(--accent);
}

.video-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.2s;
}

.video-info {
    flex-grow: 1;
    overflow: hidden;
}

.video-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

/* Responsive */
@media (max-width: 1024px) {
    .gallery-container {
        grid-template-columns: 1fr;
    }
    
    .playlist {
        max-height: 400px;
    }
}

@media (max-width: 600px) {
    .app-header {
        padding: 16px;
    }
    
    .app-header .logo h2 {
        display: none;
    }
    
    .app-content {
        padding: 16px;
    }
}
