/**
 * Legookies – Cookie Consent Banner
 * Prémiový design, nezávislý na šabloně
 *
 * Všechny třídy mají předponu .legookies-
 * Primární barva se přebírá z CSS custom property --legookies-primary
 */

/* ══════════════════════════════════════════════
   RESET / BASE
   ══════════════════════════════════════════════ */
.legookies-wrapper,
.legookies-settings-modal,
.legookies-reopen,
.legookies-overlay,
.legookies-settings-overlay {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.legookies-wrapper *,
.legookies-settings-modal *,
.legookies-reopen * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ══════════════════════════════════════════════
   OVERLAY – Modal mód
   ══════════════════════════════════════════════ */
.legookies-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.legookies-overlay.legookies-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ══════════════════════════════════════════════
   HLAVNÍ BANNER – Wrapper
   ══════════════════════════════════════════════ */
.legookies-wrapper {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.legookies-wrapper.legookies-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Bar mód (spodní lišta) ─────────────── */
.legookies-bar-mode {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 16px 16px;
}

.legookies-bar-mode .legookies-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 28px;
    box-shadow:
        0 -4px 30px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* ── Modal mód (vyskakovací okno) ────────── */
.legookies-modal-mode {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 94%;
    max-width: 540px;
}

.legookies-modal-mode.legookies-visible {
    transform: translate(-50%, -50%) scale(1);
}

.legookies-modal-mode .legookies-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* ══════════════════════════════════════════════
   IKONA
   ══════════════════════════════════════════════ */
.legookies-icon {
    flex-shrink: 0;
}

.legookies-modal-mode .legookies-icon {
    text-align: center;
}

.legookies-modal-mode .legookies-icon svg {
    width: 52px;
    height: 52px;
}

/* ══════════════════════════════════════════════
   TEXT
   ══════════════════════════════════════════════ */
.legookies-content {
    flex: 1;
    min-width: 200px;
}

.legookies-text {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.legookies-privacy-link {
    font-size: 13px;
    color: var(--legookies-primary, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.legookies-privacy-link:hover {
    opacity: 0.75;
}

.legookies-modal-mode .legookies-content {
    text-align: center;
}

/* ══════════════════════════════════════════════
   TLAČÍTKA
   ══════════════════════════════════════════════ */
.legookies-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.legookies-modal-mode .legookies-actions {
    justify-content: center;
    width: 100%;
}

.legookies-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.legookies-btn:focus-visible {
    outline: 2px solid var(--legookies-primary, #2563eb);
    outline-offset: 2px;
}

/* Přijmout vše */
.legookies-btn-accept {
    background: var(--legookies-primary, #2563eb);
    color: #ffffff;
    border-color: var(--legookies-primary, #2563eb);
}

.legookies-btn-accept:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* Odmítnout vše */
.legookies-btn-reject {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.legookies-btn-reject:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Nastavení */
.legookies-btn-settings {
    background: transparent;
    color: #64748b;
    border-color: #cbd5e1;
}

.legookies-btn-settings:hover {
    border-color: var(--legookies-primary, #2563eb);
    color: var(--legookies-primary, #2563eb);
}

/* ══════════════════════════════════════════════
   SETTINGS MODAL – Overlay
   ══════════════════════════════════════════════ */
.legookies-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(15, 23, 42, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.legookies-settings-overlay.legookies-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ══════════════════════════════════════════════
   SETTINGS MODAL – Okno
   ══════════════════════════════════════════════ */
.legookies-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 1000001;
    width: 94%;
    max-width: 500px;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.legookies-settings-modal.legookies-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.legookies-settings-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 85vh;
}

/* ── Header ─────────────────────────────── */
.legookies-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.legookies-settings-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.legookies-settings-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.legookies-settings-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── Body ───────────────────────────────── */
.legookies-settings-body {
    padding: 8px 28px;
    overflow-y: auto;
    flex: 1;
}

/* ── Kategorie ──────────────────────────── */
.legookies-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid #f1f5f9;
}

.legookies-category:last-child {
    border-bottom: none;
}

.legookies-category-info {
    flex: 1;
}

.legookies-category-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.legookies-category-info p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* ══════════════════════════════════════════════
   iOS TOGGLE
   ══════════════════════════════════════════════ */
.legookies-toggle-wrap {
    flex-shrink: 0;
    padding-top: 2px;
}

.legookies-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    cursor: pointer;
}

.legookies-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.legookies-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: background 0.25s ease;
}

.legookies-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease;
}

.legookies-toggle input:checked + .legookies-toggle-slider {
    background: var(--legookies-primary, #2563eb);
}

.legookies-toggle input:checked + .legookies-toggle-slider::before {
    transform: translateX(20px);
}

/* Disabled (Nezbytné) */
.legookies-toggle-disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.legookies-toggle-disabled .legookies-toggle-slider {
    background: var(--legookies-primary, #2563eb);
}

.legookies-toggle-disabled .legookies-toggle-slider::before {
    transform: translateX(20px);
}

/* ── Footer ─────────────────────────────── */
.legookies-settings-footer {
    display: flex;
    gap: 10px;
    padding: 16px 28px 24px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.legookies-settings-footer .legookies-btn {
    flex: 1;
    min-width: 120px;
}

/* ══════════════════════════════════════════════
   PLOVOUCÍ REOPEN TLAČÍTKO
   ══════════════════════════════════════════════ */
.legookies-reopen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999997;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    color: var(--legookies-primary, #2563eb);
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

.legookies-reopen.legookies-visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.legookies-reopen:hover {
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.16),
        0 0 0 1px rgba(0, 0, 0, 0.08);
    transform: scale(1.08);
}

.legookies-reopen:active {
    transform: scale(0.96);
}

/* ══════════════════════════════════════════════
   ANIMACE
   ══════════════════════════════════════════════ */
@keyframes legookies-slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes legookies-fadeScale {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 680px) {
    .legookies-bar-mode .legookies-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 20px;
        gap: 14px;
    }

    .legookies-bar-mode .legookies-icon {
        text-align: center;
    }

    .legookies-actions {
        justify-content: center;
        width: 100%;
    }

    .legookies-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 14px;
        font-size: 13px;
    }

    .legookies-modal-mode .legookies-inner {
        padding: 24px 20px;
    }

    .legookies-settings-header {
        padding: 20px 20px 14px;
    }

    .legookies-settings-body {
        padding: 4px 20px;
    }

    .legookies-settings-footer {
        padding: 14px 20px 20px;
    }

    .legookies-settings-footer .legookies-btn {
        font-size: 13px;
        padding: 10px 14px;
    }
}

@media (max-width: 380px) {
    .legookies-actions {
        flex-direction: column;
    }

    .legookies-settings-footer {
        flex-direction: column;
    }
}
