:root {
    --bg-dark: #09090b;       /* Bardzo ciemne tło */
    --bg-panel: #18181b;      /* Tło sidebar/kart */
    --border: #27272a;        /* Kolor obramowań */
    --primary: #ef4444;       /* Czerwień VOD */
    --primary-hover: #dc2626;
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --font: 'Outfit', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font);
    height: 100vh;
    overflow: hidden; /* Scrolluje się tylko wnętrze main */
}

.hidden { display: none !important; }

/* --- LOGOWANIE (Centrowane) --- */
#auth-screen {
    height: 100vh; display: flex; justify-content: center; align-items: center;
    background: radial-gradient(circle at top right, #271a1a, var(--bg-dark));
}
.auth-card {
    width: 100%; max-width: 400px; padding: 40px; border-radius: 16px;
    background: var(--bg-panel); border: 1px solid var(--border);
    text-align: center;
}
.logo-text { font-weight: 800; font-size: 2rem; letter-spacing: -1px; margin-bottom: 5px; }
.logo-text.small { font-size: 1.5rem; }
.accent { color: var(--primary); }
.subtitle { color: var(--text-muted); margin-bottom: 30px; font-size: 0.9rem; }
.form-stack { display: flex; flex-direction: column; gap: 15px; margin-bottom: 25px; }

/* --- INPUTY I GUZIKI --- */
.input-field {
    width: 100%; padding: 14px; background: #000; border: 1px solid var(--border);
    color: white; border-radius: 8px; font-family: var(--font); outline: none; transition: 0.2s;
}
.input-field:focus { border-color: var(--primary); }

.btn-primary {
    background: var(--primary); color: white; border: none; padding: 14px 24px;
    border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s;
    white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary.full-width { width: 100%; }

.switch-text { font-size: 0.85rem; color: var(--text-muted); }
.link { color: white; text-decoration: underline; cursor: pointer; }

/* --- GŁÓWNY LAYOUT (DASHBOARD) --- */
.layout {
    display: grid;
    grid-template-columns: 280px 1fr; /* LEWA: 280px, PRAWA: Reszta */
    height: 100vh;
}

/* --- SIDEBAR (LEWA) --- */
.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 25px;
}

.user-profile-section {
    display: flex; align-items: center; gap: 12px; margin: 30px 0;
    padding: 15px; background: rgba(255,255,255,0.03); border-radius: 12px;
}
.avatar-circle {
    width: 40px; height: 40px; background: var(--primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: bold;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 0.95rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; color: var(--text-muted); text-decoration: none;
    border-radius: 8px; transition: 0.2s; font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: #27272a; color: white; }
.icon { font-size: 0.8rem; }

.btn-logout {
    width: 100%; padding: 12px; background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.btn-logout:hover { border-color: var(--primary); color: var(--primary); }

/* --- MAIN CONTENT (PRAWA) --- */
.main-content {
    padding: 40px;
    overflow-y: auto; /* Scrollujemy tylko tutaj */
    background: var(--bg-dark);
}

/* --- ADMIN PANEL (SOLIDNY BLOK) --- */
.admin-wrapper { margin-bottom: 40px; }
.admin-card {
    background: #111; border: 1px solid #333; padding: 25px; border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.card-header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; }
.badge-admin { 
    background: rgba(239, 68, 68, 0.2); color: var(--primary); 
    padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; border: 1px solid rgba(239, 68, 68, 0.3);
}
.input-row { display: flex; gap: 15px; }

/* --- GRID FILMÓW --- */
.content-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px;
}
.section-title { font-size: 1.5rem; }
.counter { color: var(--text-muted); font-size: 0.9rem; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.video-card {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; position: relative;
    transition: transform 0.2s;
}
.video-card:hover { transform: translateY(-5px); border-color: var(--primary); }

.iframe-container { position: relative; padding-bottom: 56.25%; background: black; }
.iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.card-meta { padding: 15px; display: flex; justify-content: space-between; }
.author-label { font-size: 0.8rem; color: var(--text-muted); }

.delete-btn {
    position: absolute; top: 10px; right: 10px; z-index: 10;
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: rgba(0,0,0,0.8); color: var(--primary); cursor: pointer;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.delete-btn:hover { background: var(--primary); color: white; }

/* --- TOAST --- */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 15px 20px; background: #222; border-left: 4px solid white; color: white; border-radius: 4px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); animation: slideIn 0.3s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* RWD - Na telefonach sidebar zmienia się w kolumnę */
@media (max-width: 768px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; } /* Uproszczenie dla telefonu - normalnie dałbym hamburger menu */
    .input-row { flex-direction: column; }
}