* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #07090e;
    --bg-secondary: #0c0f17;
    --bg-card: #11141f;
    --accent: #ff3366;
    --accent-glow: rgba(255, 51, 102, 0.3);
    --accent-dark: #cc002f;
    --text-primary: #ffffff;
    --text-secondary: #8a8f99;
    --border: rgba(255, 255, 255, 0.06);
    --success: #10b981;
    --warning: #f59e0b;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Brand */
.brand {
    padding: 1.5rem 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -1px;
}

.brand-logo h1 span {
    color: var(--accent);
}

.tagline {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* Quick Actions */
.quick-actions {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.shortcut-hint {
    background: rgba(255, 51, 102, 0.1);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.shortcut-hint kbd {
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.7rem;
}

/* Control Cards */
.control-card {
    margin: 0 1rem 1rem;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.card-header i {
    color: var(--accent);
}

.badge {
    background: rgba(255, 51, 102, 0.15);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    margin-left: auto;
    color: var(--accent);
}

/* Master Grid */
.master-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ctrl {
    padding: 10px 6px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    font-family: inherit;
}

.ctrl.play {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
}

.ctrl.pause, .ctrl.mute, .ctrl.unmute {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.ctrl.restart {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ctrl.stop {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.ctrl:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

/* Add Section */
.add-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.url-input-wrapper, .title-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 12px;
    transition: all 0.2s;
}

.url-input-wrapper:focus-within, .title-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.url-input-wrapper i, .title-input-wrapper i {
    color: var(--accent);
    font-size: 0.9rem;
}

.url-input-wrapper input, .title-input-wrapper input {
    background: transparent;
    border: none;
    padding: 12px 10px;
    color: white;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
    font-family: inherit;
}

#addVideoBtn {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    padding: 12px;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#addVideoBtn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.info-tag {
    margin-top: 10px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Layout Slider */
.layout-slider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.layout-slider span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.layout-slider input {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    -webkit-appearance: none;
}

.layout-slider input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.layout-presets {
    display: flex;
    gap: 8px;
}

.layout-presets button {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.layout-presets button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Tips */
.tips-card {
    margin: 0 1rem 1rem;
    padding: 1rem;
    background: rgba(255, 51, 102, 0.05);
    border-radius: 16px;
}

.tip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 6px 0;
}

.tip i {
    width: 20px;
    color: var(--accent);
}

/* ========== MAIN CONTENT ========== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

.main-nav {
    padding: 1rem 1.5rem;
    background: rgba(7, 9, 14, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-icon {
    display: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.title-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-section i {
    font-size: 1.2rem;
    color: var(--accent);
}

.title-section h2 {
    font-size: 1rem;
    font-weight: 500;
}

.count-pill {
    background: var(--accent);
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    color: #ef4444;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 6px 14px;
    gap: 8px;
}

.search-box i {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.8rem;
    outline: none;
    width: 160px;
    font-family: inherit;
}

/* Grid Wrapper */
.grid-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.video-grid {
    display: grid;
    gap: 1.2rem;
    transition: all 0.3s;
}

.video-grid[data-layout="1"] { grid-template-columns: 1fr; }
.video-grid[data-layout="2"] { grid-template-columns: repeat(2, 1fr); }
.video-grid[data-layout="3"] { grid-template-columns: repeat(3, 1fr); }
.video-grid[data-layout="4"] { grid-template-columns: repeat(4, 1fr); }
.video-grid[data-layout="5"] { grid-template-columns: repeat(5, 1fr); }

/* Video Card */
.video-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
    animation: fadeInScale 0.3s ease;
}

.video-card:active {
    cursor: grabbing;
}

.video-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.video-card.drag-over {
    border-color: var(--accent);
    transform: scale(1.02);
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.5);
}

.video-wrapper {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.video-title {
    font-size: 0.8rem;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-actions {
    display: flex;
    gap: 6px;
}

.video-actions button {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 0.7rem;
}

.video-actions button:hover {
    background: var(--accent);
    color: white;
}

.video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--accent);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Spotlight Modal */
.spotlight {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.spotlight.active {
    display: flex;
}

.spotlight-content {
    width: 90%;
    max-width: 1200px;
    position: relative;
}

.spotlight-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
}

.spotlight-player {
    aspect-ratio: 16 / 9;
    background: black;
    border-radius: 20px;
    overflow: hidden;
}

.spotlight-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.spotlight-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 16px;
}

.return-btn {
    background: var(--accent);
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-family: inherit;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.8rem;
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.toast.show {
    transform: translateX(0);
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        height: 100%;
        transform: translateX(-100%);
        z-index: 100;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .menu-icon {
        display: block;
    }
    .video-grid[data-layout="3"],
    .video-grid[data-layout="4"],
    .video-grid[data-layout="5"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr !important;
    }
    .nav-right {
        flex-direction: column;
        width: 100%;
    }
    .search-box {
        width: 100%;
    }
    .search-box input {
        width: 100%;
    }
}

/* Footer Styles - Add to existing style.css */
.app-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(7, 9, 14, 0.95);
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.separator {
    color: var(--border);
}

.copyright {
    font-size: 0.7rem;
    color: var(--text-secondary);
}