:root {
    --primary: #222f3e;
    --secondary: #8395a7;
    --text-light: #f1f2f6;
    --text-muted: #c8d6e5;
    --bg-dark: #1e272e;
    --glass-bg: rgba(34, 47, 62, 0.75);
    --glass-border: rgba(131, 149, 167, 0.3);
    --success: #1dd1a1;
    --error: #ff6b6b;
    --font-main: 'Outfit', 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--primary);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Authentication Layout (Login/Register) */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at top right, var(--secondary), var(--primary));
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.form-header h1 {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.form-header p {
    color: var(--text-muted);
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(131, 149, 167, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background-color: #576574;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--secondary);
    font-weight: 600;
}

.auth-footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Dashboard & Video Carousel */
.dashboard-header {
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 39, 46, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 1px;
}

.user-menu a {
    color: var(--text-muted);
    margin-left: 20px;
    font-size: 0.95rem;
}

.user-menu a.logout-btn {
    border: 1px solid var(--secondary);
    padding: 8px 16px;
    border-radius: 6px;
}

.user-menu a.logout-btn:hover {
    background: var(--secondary);
    color: white;
}

.main-content {
    padding: 3rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.video-carousel-container {
    position: relative;
    padding: 0 40px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    perspective: 1000px; /* For 3D effects if needed */
}

/* Fallback to flex for true carousel if needed via JS, but grid is often better for "cards side by side" as requested unless explicit slide-one-by-one is needed. 
   The user said "videos podem ficar em carrosel... cada card lado a lado". 
   Technically a flex container with overflow-x scroll is a simple pure CSS carousel. */
.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 2rem;
    padding: 1rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) transparent;
}

.carousel-track::-webkit-scrollbar {
    height: 8px;
}
.carousel-track::-webkit-scrollbar-track {
    background: transparent; 
}
.carousel-track::-webkit-scrollbar-thumb {
    background-color: var(--secondary); 
    border-radius: 20px;
}

.video-card {
    flex: 0 0 320px; /* Fixed width for carousel items */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: var(--secondary);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    background-color: #000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    font-size: 3rem;
    color: rgba(255,255,255,0.8);
    transition: 0.3s;
}

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

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

.video-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.video-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-available {
    background: rgba(29, 209, 161, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-locked {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Modal for watching video */
.video-modal {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.video-modal.active {
    display: flex;
}

.video-container {
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
}

/* Admin Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: var(--glass-bg);
    border-radius: 12px;
    overflow: hidden;
}

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

.admin-table th {
    background: rgba(131, 149, 167, 0.1);
    color: var(--secondary);
}

.action-btn {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 5px;
    cursor: pointer;
    border: none;
}

.btn-edit { background: orange; color: white; }
.btn-delete { background: var(--error); color: white; }

/* Responsive */
@media (max-width: 768px) {
    .glass-card { padding: 2rem; }
    .hero-section h2 { font-size: 2rem; }
    .carousel-track { scroll-snap-type: x mandatory; }
    .video-card { scroll-snap-align: center; }
}
