/* ==========================================================================
   COOKIE CONSENT — CRT Terminal Authorization Dialog
   GDPR/EU compliant cookie banner for Gilligan Tech
   ========================================================================== */

/* ==========================================================================
   OVERLAY & CONTAINER
   ========================================================================== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cookie-consent__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cookie-consent.visible .cookie-consent__backdrop {
    opacity: 1;
}

.cookie-consent__panel {
    position: relative;
    max-width: 720px;
    margin: 0 auto 1.5rem;
    background: var(--crt-dark, #0d0d14);
    border: 1px solid var(--crt-border-bright, rgba(0, 255, 65, 0.25));
    border-top: 2px solid var(--crt-green, #00ff41);
    box-shadow:
        0 0 30px rgba(0, 255, 65, 0.08),
        0 -4px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(0, 255, 65, 0.06);
    overflow: hidden;
}

/* Scanline overlay */
.cookie-consent__panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 65, 0.012) 2px,
            rgba(0, 255, 65, 0.012) 4px
        );
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   HEADER — Terminal Title Bar
   ========================================================================== */

.cookie-consent__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 255, 65, 0.04);
    border-bottom: 1px solid var(--crt-border, rgba(0, 255, 65, 0.12));
}

.cookie-consent__icon {
    font-family: var(--font-terminal, 'VT323', monospace);
    font-size: 1.2rem;
    color: var(--crt-amber, #ffb000);
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.4);
    animation: cookie-blink 1.5s step-end infinite;
    flex-shrink: 0;
}

@keyframes cookie-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.cookie-consent__title {
    font-family: var(--font-terminal, 'VT323', monospace);
    font-size: 1.1rem;
    color: var(--crt-green, #00ff41);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
    flex: 1;
}

.cookie-consent__close {
    font-family: var(--font-terminal, 'VT323', monospace);
    font-size: 1rem;
    color: var(--crt-text-muted, #5a5a52);
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    transition: all 0.15s ease;
    display: none;
}

.cookie-consent--has-consent .cookie-consent__close {
    display: block;
}

.cookie-consent__close:hover {
    color: var(--crt-amber, #ffb000);
    border-color: var(--crt-border, rgba(0, 255, 65, 0.12));
}

/* ==========================================================================
   BODY — Message & Controls
   ========================================================================== */

.cookie-consent__body {
    padding: 1.25rem;
    position: relative;
    z-index: 2;
}

.cookie-consent__message {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--crt-text-dim, #8a8a7e);
    margin: 0 0 1.25rem;
}

.cookie-consent__message a {
    color: var(--crt-cyan, #00d4ff);
    text-decoration: underline;
    text-decoration-color: rgba(0, 212, 255, 0.3);
    text-underline-offset: 2px;
    transition: all 0.15s ease;
}

.cookie-consent__message a:hover {
    color: var(--crt-cyan, #00d4ff);
    text-decoration-color: var(--crt-cyan, #00d4ff);
    text-shadow: 0 0 6px rgba(0, 212, 255, 0.3);
}

/* ==========================================================================
   COOKIE CATEGORIES — Toggle Switches
   ========================================================================== */

.cookie-consent__categories {
    display: grid;
    gap: 0;
    margin-bottom: 1.25rem;
    border: 1px solid var(--crt-border, rgba(0, 255, 65, 0.12));
}

.cookie-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--crt-border, rgba(0, 255, 65, 0.12));
    transition: background 0.15s ease;
}

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

.cookie-category:hover {
    background: rgba(0, 255, 65, 0.02);
}

/* Terminal-style toggle switch */
.cookie-toggle {
    position: relative;
    width: 38px;
    height: 18px;
    flex-shrink: 0;
}

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

.cookie-toggle__track {
    position: absolute;
    inset: 0;
    background: var(--crt-surface, #111118);
    border: 1px solid var(--crt-border-bright, rgba(0, 255, 65, 0.25));
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--crt-text-muted, #5a5a52);
    transition: all 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle__track {
    border-color: var(--crt-green, #00ff41);
    box-shadow: 0 0 6px rgba(0, 255, 65, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle__track::after {
    left: 22px;
    background: var(--crt-green, #00ff41);
    box-shadow: 0 0 6px rgba(0, 255, 65, 0.4);
}

.cookie-toggle input:disabled + .cookie-toggle__track {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle input:disabled + .cookie-toggle__track::after {
    background: var(--crt-green-dim, #00cc33);
}

.cookie-category__info {
    flex: 1;
    min-width: 0;
}

.cookie-category__name {
    font-family: var(--font-terminal, 'VT323', monospace);
    font-size: 0.95rem;
    color: var(--crt-text-bright, #eeeee0);
    letter-spacing: 0.05em;
}

.cookie-category__name::before {
    content: '> ';
    color: var(--crt-green-muted, #009926);
}

.cookie-category__desc {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 0.65rem;
    color: var(--crt-text-muted, #5a5a52);
    line-height: 1.4;
    margin-top: 0.1rem;
}

.cookie-category__status {
    font-family: var(--font-terminal, 'VT323', monospace);
    font-size: 0.8rem;
    color: var(--crt-text-muted, #5a5a52);
    letter-spacing: 0.05em;
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.cookie-category__status--required {
    color: var(--crt-green-dim, #00cc33);
}

.cookie-category__status--on {
    color: var(--crt-green, #00ff41);
    text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

.cookie-category__status--off {
    color: var(--crt-text-muted, #5a5a52);
}

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */

.cookie-consent__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-btn {
    font-family: var(--font-terminal, 'VT323', monospace);
    font-size: 1rem;
    letter-spacing: 0.08em;
    padding: 0.5rem 1.25rem;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    flex: 1;
    text-align: center;
    min-width: 120px;
}

/* Accept All — primary CTA */
.cookie-btn--accept {
    color: var(--crt-dark, #0d0d14);
    background: var(--crt-green, #00ff41);
    border-color: var(--crt-green, #00ff41);
}

.cookie-btn--accept:hover {
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4), 0 0 40px rgba(0, 255, 65, 0.15);
    transform: translateY(-1px);
}

/* Save Preferences — secondary */
.cookie-btn--save {
    color: var(--crt-amber, #ffb000);
    background: transparent;
    border-color: var(--crt-amber-dim, #cc8c00);
}

.cookie-btn--save:hover {
    background: rgba(255, 176, 0, 0.08);
    border-color: var(--crt-amber, #ffb000);
    box-shadow: 0 0 12px rgba(255, 176, 0, 0.2);
}

/* Reject All — tertiary */
.cookie-btn--reject {
    color: var(--crt-text-muted, #5a5a52);
    background: transparent;
    border-color: var(--crt-border, rgba(0, 255, 65, 0.12));
}

.cookie-btn--reject:hover {
    color: var(--crt-text-dim, #8a8a7e);
    border-color: var(--crt-border-bright, rgba(0, 255, 65, 0.25));
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   RE-OPEN BUTTON — Floating Cookie Settings
   ========================================================================== */

.cookie-settings-btn {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 9999;
    font-family: var(--font-terminal, 'VT323', monospace);
    font-size: 0.85rem;
    color: var(--crt-text-muted, #5a5a52);
    background: var(--crt-dark, #0d0d14);
    border: 1px solid var(--crt-border, rgba(0, 255, 65, 0.12));
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cookie-settings-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cookie-settings-btn:hover {
    color: var(--crt-green, #00ff41);
    border-color: var(--crt-border-bright, rgba(0, 255, 65, 0.25));
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

.cookie-settings-btn i {
    font-size: 0.8rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .cookie-consent__panel {
        margin: 0 0.75rem 1rem;
    }

    .cookie-consent__body {
        padding: 1rem;
    }

    .cookie-consent__actions {
        flex-direction: column;
    }

    .cookie-btn {
        min-width: 100%;
    }

    .cookie-category {
        padding: 0.6rem 0.75rem;
    }

    .cookie-category__desc {
        display: none;
    }
}

@media (max-width: 480px) {
    .cookie-consent__header {
        padding: 0.6rem 1rem;
    }

    .cookie-consent__title {
        font-size: 0.95rem;
    }

    .cookie-consent__message {
        font-size: 0.75rem;
    }
}
