/* =======================================================================
   LUVEEDU COOKIE BANNER - luvcookie.css (v1)
   Consent banner for all Luveedu products.
   Pairs with: js/v1/luvcookie.js

   USAGE
   -----
   <link rel="stylesheet" href="https://files.luveedu.com/ui-library/css/v1/luvcookie.css">
   <script src="https://files.luveedu.com/ui-library/js/v1/luvcookie.js"></script>
   <script>
     LuvCookie.init({
       title: 'We value your privacy',
       message: 'We use cookies to improve your experience.',
       layout: 'bar',        // bar | card | modal
       position: 'bottom',   // bar: bottom|top  card: bottom-left|bottom-right|top-left|top-right
       theme: 'auto',        // auto | light | dark
       animation: 'slide',   // slide | fade | scale | bounce
       expiry: '1y'          // 1y | 6m | 1m | 45d | 30d | 7d | number(days)
     });
   </script>

   Works standalone. When css/v1/library.css is also loaded it inherits the
   same fonts, 6px radius and colour language.
   ======================================================================= */

/* ------------------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------------------ */
:root {
    --luvc-z: 9998;
    --luvc-radius: 6px;
    --luvc-font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --luvc-duration: 460ms;
    --luvc-ease: cubic-bezier(0.2, 0, 0.2, 1);
    --luvc-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --luvc-max-width: 460px;
}

/* ------------------------------------------------------------------------
   2. ROOT + LAYOUTS
   ------------------------------------------------------------------------ */
.luvc {
    position: fixed;
    z-index: var(--luvc-z);
    box-sizing: border-box;
    font-family: var(--luvc-font);
    color: var(--luvc-fg);
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    transition: opacity var(--luvc-duration) var(--luvc-ease);
}

.luvc *,
.luvc *::before,
.luvc *::after { box-sizing: border-box; }

.luvc.luvc-in { opacity: 1; }
.luvc.luvc-out { opacity: 0; }

/* Bar - full width strip */
.luvc[data-layout='bar'] { left: 0; right: 0; }
.luvc[data-layout='bar'][data-position='bottom'] { bottom: 0; }
.luvc[data-layout='bar'][data-position='top'] { top: 0; }

/* Card - floating panel */
.luvc[data-layout='card'] { width: calc(100% - 32px); max-width: var(--luvc-max-width); }
.luvc[data-layout='card'][data-position='bottom-left'] { left: 16px; bottom: 16px; }
.luvc[data-layout='card'][data-position='bottom-right'] { right: 16px; bottom: 16px; }
.luvc[data-layout='card'][data-position='top-left'] { left: 16px; top: 16px; }
.luvc[data-layout='card'][data-position='top-right'] { right: 16px; top: 16px; }

/* Modal - centred with overlay */
.luvc[data-layout='modal'] {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 12, 24, 0.55);
}
.luvc[data-layout='modal'] .luvc-card { width: 100%; max-width: 540px; }

/* ------------------------------------------------------------------------
   3. CARD
   ------------------------------------------------------------------------ */
.luvc-card {
    position: relative;
    background: var(--luvc-bg);
    border: 1px solid var(--luvc-border);
    border-radius: var(--luvc-radius);
    box-shadow: var(--luvc-shadow);
    overflow: hidden;
}

.luvc[data-layout='bar'] .luvc-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}
.luvc[data-layout='bar'][data-position='bottom'] .luvc-card { border-bottom: 0; }
.luvc[data-layout='bar'][data-position='top'] .luvc-card { border-top: 0; }

/* ------------------------------------------------------------------------
   4. BODY / HEAD / COPY
   ------------------------------------------------------------------------ */
.luvc-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.luvc[data-layout='bar'] .luvc-body {
    max-width: 1200px;
    margin: 0 auto;
}

.luvc[data-layout='card'] .luvc-body,
.luvc[data-layout='modal'] .luvc-body {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
}

.luvc-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.luvc-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--luvc-radius);
    background: var(--luvc-icon-bg);
    color: var(--luvc-accent);
}

.luvc-icon svg { width: 20px; height: 20px; display: block; }

.luvc-copy { min-width: 0; }

.luvc-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--luvc-fg);
}

.luvc-text {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--luvc-muted);
}

.luvc-text a,
.luvc-link {
    color: var(--luvc-accent);
    text-decoration: underline;
    font-weight: 600;
}

/* ------------------------------------------------------------------------
   5. ACTIONS + BUTTONS
   ------------------------------------------------------------------------ */
.luvc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.luvc[data-layout='card'] .luvc-actions,
.luvc[data-layout='modal'] .luvc-actions { justify-content: flex-end; }

.luvc-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: var(--luvc-radius);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, filter 140ms ease;
}

.luvc-btn:active { transform: translateY(1px); }

.luvc-btn-primary {
    background: var(--luvc-accent);
    border-color: var(--luvc-accent);
    color: #ffffff;
}
.luvc-btn-primary:hover { filter: brightness(1.06); }

.luvc-btn-secondary {
    background: transparent;
    border-color: var(--luvc-border-strong);
    color: var(--luvc-fg);
}
.luvc-btn-secondary:hover { background: var(--luvc-hover); }

.luvc-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--luvc-muted);
    padding: 0 10px;
}
.luvc-btn-ghost:hover { color: var(--luvc-fg); background: var(--luvc-hover); }

/* ------------------------------------------------------------------------
   6. PREFERENCES PANEL
   ------------------------------------------------------------------------ */
.luvc-prefs { padding: 0 20px 20px; }

.luvc-prefs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 12px;
    border-top: 1px solid var(--luvc-border);
}

.luvc-prefs-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--luvc-fg); }

.luvc-close {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: var(--luvc-muted);
    border-radius: var(--luvc-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 140ms ease, color 140ms ease;
}
.luvc-close:hover { background: var(--luvc-hover); color: var(--luvc-fg); }
.luvc-close svg { width: 16px; height: 16px; display: block; }

.luvc-cats {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.luvc-cat {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--luvc-border);
    border-radius: var(--luvc-radius);
    background: var(--luvc-surface);
}

.luvc-cat-name { margin: 0; font-size: 13px; font-weight: 700; color: var(--luvc-fg); }
.luvc-cat-desc { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: var(--luvc-muted); }

/* Switch */
.luvc-switch { position: relative; flex: 0 0 auto; display: inline-flex; }
.luvc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.luvc-switch-track {
    width: 40px;
    height: 22px;
    border-radius: 9999px;
    background: var(--luvc-switch-off);
    position: relative;
    transition: background 160ms ease;
    cursor: pointer;
}

.luvc-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 160ms ease;
}

.luvc-switch input:checked + .luvc-switch-track { background: var(--luvc-accent); }
.luvc-switch input:checked + .luvc-switch-track::after { transform: translateX(18px); }
.luvc-switch input:disabled + .luvc-switch-track { opacity: 0.55; cursor: not-allowed; }
.luvc-switch input:focus-visible + .luvc-switch-track { outline: 2px solid var(--luvc-accent); outline-offset: 2px; }

/* ------------------------------------------------------------------------
   7. ANIMATIONS
   ------------------------------------------------------------------------ */
.luvc[data-anim='slide'] .luvc-card {
    transform: translateY(24px);
    transition: transform var(--luvc-duration) var(--luvc-ease-spring);
}
.luvc[data-anim='slide'].luvc-in .luvc-card { transform: translateY(0); }
.luvc[data-anim='slide'].luvc-out .luvc-card { transform: translateY(24px); }

.luvc[data-anim='scale'] .luvc-card {
    transform: scale(0.94);
    transition: transform var(--luvc-duration) var(--luvc-ease-spring);
}
.luvc[data-anim='scale'].luvc-in .luvc-card { transform: scale(1); }
.luvc[data-anim='scale'].luvc-out .luvc-card { transform: scale(0.94); }

.luvc[data-anim='bounce'] .luvc-card { transform: translateY(40px) scale(0.96); }
.luvc[data-anim='bounce'].luvc-in .luvc-card {
    animation: luvc-bounce var(--luvc-duration) var(--luvc-ease-spring) both;
}

@keyframes luvc-bounce {
    0%   { transform: translateY(40px) scale(0.96); opacity: 0; }
    60%  { transform: translateY(-6px) scale(1.01); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Icon pops in with the card */
.luvc.luvc-in .luvc-icon { animation: luvc-icon-pop 520ms var(--luvc-ease-spring) both; }

@keyframes luvc-icon-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ------------------------------------------------------------------------
   8. PALETTES
   ------------------------------------------------------------------------ */
.luvc[data-theme='light'] {
    --luvc-bg: #ffffff;
    --luvc-surface: #f8fafc;
    --luvc-border: #d6deea;
    --luvc-border-strong: #c2cedf;
    --luvc-fg: #111827;
    --luvc-muted: #64748b;
    --luvc-accent: #2563eb;
    --luvc-icon-bg: #eff6ff;
    --luvc-hover: rgba(15, 23, 42, 0.06);
    --luvc-switch-off: #cbd5e1;
    --luvc-shadow: 0 0 24px rgba(15, 23, 42, 0.10), 0 18px 40px -10px rgba(15, 23, 42, 0.28), 0 8px 18px -8px rgba(15, 23, 42, 0.18);
}

.luvc[data-theme='dark'] {
    --luvc-bg: #121c31;
    --luvc-surface: #18253e;
    --luvc-border: #273753;
    --luvc-border-strong: #385070;
    --luvc-fg: #eaf2ff;
    --luvc-muted: #8ba0c4;
    --luvc-accent: #3b82f6;
    --luvc-icon-bg: #101f38;
    --luvc-hover: rgba(255, 255, 255, 0.08);
    --luvc-switch-off: #385070;
    --luvc-shadow: 0 0 24px rgba(0, 0, 0, 0.35), 0 18px 40px -10px rgba(0, 0, 0, 0.55), 0 8px 18px -8px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------------------
   9. RESPONSIVE
   ------------------------------------------------------------------------ */
@media (max-width: 640px) {
    .luvc[data-layout='bar'] .luvc-body {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .luvc[data-layout='bar'] .luvc-actions { justify-content: stretch; }
    .luvc[data-layout='bar'] .luvc-actions .luvc-btn { flex: 1 1 auto; }

    .luvc[data-layout='card'] {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
    }
    .luvc[data-layout='card'][data-position='top-left'],
    .luvc[data-layout='card'][data-position='top-right'] { top: 12px; }

    .luvc[data-layout='modal'] .luvc-card { max-width: none; }
}
