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

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card: #222;
    --accent: #00d4aa;
    --accent-hover: #00e8bb;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --border: #333;
    --shadow: rgba(0, 212, 170, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #00ffcc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

main {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.controls input,
.controls select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.controls input:focus,
.controls select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow);
}

.controls input::placeholder {
    color: var(--text-secondary);
}

.controls button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, #00b894 100%);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.controls button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.controls button:active {
    transform: translateY(0);
}

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

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow);
    border-color: var(--accent);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
    overflow: hidden;
}

.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail video {
    transform: scale(1.05);
}

.video-thumbnail .play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay svg {
    width: 64px;
    height: 64px;
    fill: var(--accent);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s;
}

.play-overlay:hover svg {
    transform: scale(1.1);
}

.video-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.video-style {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 500;
}

.video-duration {
    font-variant-numeric: tabular-nums;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.video-actions button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.video-actions button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 212, 170, 0.1);
}

.loading,
.empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hidden {
    display: none !important;
}

footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Modal for full-screen video */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 212, 170, 0.2);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-card);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 1001;
}

.modal-close:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: rotate(90deg);
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls input,
    .controls select,
    .controls button {
        width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}