:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --secondary: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Auth Page Styles */
.auth-container {
    max-width: 400px;
    width: 90%;
    margin: auto;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

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

.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Dashboard Styles */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: white;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .video-title {
        font-size: 0.9rem;
    }
    
    .video-meta {
        font-size: 0.7rem;
    }
}

@media (max-width: 640px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .container {
        margin: 1rem auto;
    }
    
    .close-modal {
        top: -35px;
        right: 0;
        font-size: 1.5rem;
    }
}

/* Video Cards with Thumbnails */
.video-card {
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(45deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.play-button-icon {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s;
}

.video-card:hover .play-button-icon {
    transform: scale(1.1);
}

.play-button-icon svg {
    fill: white;
    width: 22px;
    margin-left: 3px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    position: relative;
    padding: 1rem;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-video-container {
    width: 100%;
    background: black;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border: 1px solid var(--glass-border);
}

.modal-video-container video {
    width: 100%;
    display: block;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 10px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-header h2 {
    color: white;
    font-weight: 700;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.video-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.direct-link {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    opacity: 0.8;
}

.direct-link:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Admin Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin { background: rgba(236, 72, 153, 0.2); color: var(--secondary); }
.badge-user { background: rgba(99, 102, 241, 0.2); color: var(--primary); }

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}
