/* ===========================
   ZÁKLADNÉ PREMENNÉ
   =========================== */
:root {
    --bg-main: #020617;
    --bg-gradient-top: #111827;
    --bg-card: rgba(15, 23, 42, 0.96);
    --bg-card-soft: rgba(17, 24, 39, 0.9);
    --border-soft: rgba(55, 65, 81, 0.9);
    --border-subtle: rgba(148, 163, 184, 0.4);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-soft: #6b7280;
    --accent: #22c55e;
    --accent-dark: #16a34a;
    --danger: #ef4444;
    --danger-soft: rgba(220, 38, 38, 0.18);
    --success-soft: rgba(22, 163, 74, 0.18);
}

/* ===========================
   RESET & BASE
   =========================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, var(--bg-gradient-top) 0, var(--bg-main) 55%, #000 100%);
    color: var(--text-main);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===========================
   TLAČIDLÁ
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
    background: rgba(31, 41, 55, 0.95);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #022c22;
    font-weight: 600;
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-large {
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
}

.btn-small {
    padding: 0.28rem 0.7rem;
    font-size: 0.8rem;
}

/* ===========================
   FORMULÁRE
   =========================== */
.form-group {
    margin-bottom: 0.9rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
    background: #020617;
    color: var(--text-main);
    font-size: 0.9rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

/* ===========================
   FLASH SPRÁVY
   =========================== */
.message {
    padding: 0.55rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.9rem;
}

.success-message {
    background: var(--success-soft);
    border: 1px solid rgba(34, 197, 94, 0.65);
    color: #bbf7d0;
}

.error-message {
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, 0.8);
    color: #fecaca;
}

/* ===========================
   LOGIN STRÁNKA
   =========================== */
body.login-page-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-background {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, var(--bg-gradient-top) 0, var(--bg-main) 55%, #000 100%);
    opacity: 0.9;
    z-index: -1;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 18px;
    padding: 2rem 2rem 2.3rem;
    box-shadow: 0 20px 45px rgba(0,0,0,0.6);
}

.login-header {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
}

.logo-f1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    font-weight: 800;
    font-size: 1rem;
    color: #022c22;
}

.logo-text {
    font-weight: 800;
    font-size: 1.1rem;
}

.login-subtitle {
    margin-top: 0.1rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-form .form-group:last-of-type {
    margin-bottom: 0.4rem;
}

.register-link {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.register-link:hover {
    color: var(--accent);
}

/* ===========================
   LANDING STRÁNKA (index.php)
   =========================== */
.landing-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.landing-card {
    max-width: 900px;
    width: 100%;
    background: var(--bg-card);
    border-radius: 18px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 45px rgba(0,0,0,0.6);
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    gap: 2rem;
}

@media (max-width: 800px) {
    .landing-card {
        grid-template-columns: 1fr;
    }
}

.landing-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.7rem;
}

.landing-title span {
    color: var(--accent);
}

.landing-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.landing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    color: #e5e7eb;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.landing-small {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.landing-preview {
    border-radius: 14px;
    background: radial-gradient(circle at top, #0f172a 0, #020617 70%);
    padding: 1rem;
    border: 1px solid rgba(55, 65, 81, 0.7);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.preview-window {
    border-radius: 10px;
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #0f172a, #1f2937);
    overflow: hidden;
}

.preview-countdown {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-main);
    text-shadow: 0 0 30px rgba(22, 163, 74, 0.9);
}

.preview-label {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-subtle);
}

.preview-bubbles {
    display: flex;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bubble {
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(31, 41, 55, 0.9);
}

/* ===========================
   REGISTRÁCIA (register.php)
   =========================== */
.register-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.register-card {
    max-width: 480px;
    width: 100%;
    background: var(--bg-card);
    border-radius: 18px;
    padding: 2rem 2rem 2.3rem;
    box-shadow: 0 20px 45px rgba(0,0,0,0.6);
}

.register-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 0.3rem;
}

.register-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.message-error {
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, 0.8);
    color: #fecaca;
    padding: 0.6rem 0.7rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.message-error ul {
    margin: 0.2rem 0 0;
    padding-left: 1.1rem;
}

.below-link {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--text-soft);
}

.below-link a {
    color: var(--accent);
}

.below-link a:hover {
    text-decoration: underline;
}

/* ===========================
   ADMIN (overlays, edit)
   =========================== */
.admin-body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at top, var(--bg-gradient-top) 0, var(--bg-main) 55%, #000 100%);
    color: var(--text-main);
}

.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.3rem;
}

.admin-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
}

/* pôvodne bola len jedna kolóna – nižšie to prepíšeme na 2 */
.admin-main {
    display: grid;
    grid-template-columns: minmax(0, 3fr);
    gap: 1rem;
}

.admin-card {
    background: var(--bg-card-soft);
    border-radius: 14px;
    padding: 1.3rem 1.2rem 1.4rem;
    border: 1px solid var(--border-soft);
    margin-bottom: 1rem;
}

.admin-card h2 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.admin-alert {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: var(--success-soft);
    border: 1px solid rgba(34,197,94,0.7);
    color: #bbf7d0;
}

/* TABUĽKY */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th,
.table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.table th {
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.table tr:hover td {
    background: rgba(15, 23, 42, 0.8);
}

/* PREVIEW OVERLAYU V ADMINE – pôvodná verzia, nižšie ju prepíšeme novou */
.admin-preview-section {
    margin-top: 0.5rem;
}

#overlayPreviewWrapper {
    margin-top: 0.7rem;
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: #000;
}

#overlayPreview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.preview-mode {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-soft);
}

/* ===========================
   OVERLAY BODY (pre overlay.php)
   =========================== */
.overlay-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent; /* overlay bude často na chroma key pozadí */
}

#overlay-root {
    position: relative;
    width: 1920px;
    height: 1080px;
}

/* Príklady, ak používaš ID pre prvky (môžeš doladiť podľa svojho HTML):
   #backgroundLayer, #videoWrapper, #countdown, #customText, #customText2 atď.
*/

#backgroundLayer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

#videoWrapper {
    position: absolute;
    width: 480px;
    height: 270px;
    overflow: hidden;
}

#videoWrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#countdown {
    position: absolute;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(0,0,0,0.9);
}

#customText,
#customText2 {
    position: absolute;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

/* =========================================
   NOVÝ LAYOUT – menu vľavo, náhľad vpravo hore
   ========================================= */
.admin-main {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.3fr);
    gap: 1.5rem;
    align-items: flex-start;
}

/* pravý stĺpec (náhľad) – drží sa hore pri scrollovaní */
.admin-preview-section {
    margin-top: 0;
    position: sticky;
    top: 0.75rem;
}

/* box pre náhľad overlayu – výška sa prepočítava v JS cez scale() */
#overlayPreviewWrapper {
    margin-top: 0.5rem;
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: #000;
}

#overlayPreview {
    position: absolute;
    left: 0;
    top: 0;
    border: none;
}

/* mobil / užšie displeje – všetko pod seba, sticky vypneme */
@media (max-width: 1024px) {
    .admin-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-preview-section {
        position: static;
        margin-top: 1rem;
    }

    #overlayPreviewWrapper {
        margin-top: 0.7rem;
    }
}
