/**
 * Velo Cookies Suite - Modern Obsidian Glassmorphism & Light Luxury Frontend Styling
 * Compliant with WCAG 2.1 AA contrast & responsive mobile standards
 */

:root {
    --velo-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --velo-radius-lg: 18px;
    --velo-radius-md: 12px;
    --velo-radius-sm: 8px;
    --velo-radius-full: 9999px;
    --velo-transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Dark Obsidian Theme (Default) */
    --velo-bg-glass: rgba(15, 23, 42, 0.88);
    --velo-border-glass: rgba(255, 255, 255, 0.12);
    --velo-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(14, 165, 233, 0.12);
    --velo-text-primary: #f8fafc;
    --velo-text-secondary: #cbd5e1;
    --velo-text-muted: #94a3b8;
    
    --velo-accent: #0ea5e9;
    --velo-accent-hover: #38bdf8;
    --velo-accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #2563eb 100%);
    --velo-accent-glow: 0 0 24px rgba(14, 165, 233, 0.45);
    
    --velo-surface-hover: rgba(255, 255, 255, 0.06);
    --velo-surface-card: rgba(30, 41, 59, 0.7);
    --velo-surface-border: rgba(255, 255, 255, 0.08);
}

/* Light Luxury Theme Override */
.velo-cookies-wrapper.velo-theme-light {
    --velo-bg-glass: rgba(255, 255, 255, 0.94);
    --velo-border-glass: rgba(0, 0, 0, 0.09);
    --velo-shadow: 0 20px 55px rgba(15, 23, 42, 0.15), 0 0 20px rgba(14, 165, 233, 0.08);
    --velo-text-primary: #0f172a;
    --velo-text-secondary: #334155;
    --velo-text-muted: #64748b;
    --velo-surface-hover: rgba(0, 0, 0, 0.04);
    --velo-surface-card: rgba(241, 245, 249, 0.85);
    --velo-surface-border: rgba(0, 0, 0, 0.08);
}

/* Base Wrapper */
.velo-cookies-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999999;
    font-family: var(--velo-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--velo-text-secondary);
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.velo-cookie-banner,
.velo-cookie-modal,
.velo-reopen-badge {
    pointer-events: auto;
}

.velo-cookies-wrapper *,
.velo-cookies-wrapper *::before,
.velo-cookies-wrapper *::after {
    box-sizing: inherit;
}

/* -------------------------------------------------------------
 * 1. MAIN BANNER CARD
 * ----------------------------------------------------------- */
.velo-cookie-banner {
    position: fixed;
    z-index: 99999999;
    background: var(--velo-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--velo-border-glass);
    box-shadow: var(--velo-shadow);
    transition: var(--velo-transition);
    animation: veloSlideUp 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Position: Bottom Bar */
.velo-pos-bottom_bar .velo-cookie-banner {
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: var(--velo-radius-lg);
    padding: 20px 24px;
}

/* Position: Corner Floating Boxes */
.velo-pos-bottom_left_box .velo-cookie-banner {
    bottom: 24px;
    left: 24px;
    max-width: 440px;
    border-radius: var(--velo-radius-lg);
    padding: 24px;
}

.velo-pos-bottom_right_box .velo-cookie-banner {
    bottom: 24px;
    right: 24px;
    max-width: 440px;
    border-radius: var(--velo-radius-lg);
    padding: 24px;
}

/* Position: Modal Center */
.velo-pos-modal_center .velo-cookie-banner {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 540px;
    width: 90%;
    border-radius: var(--velo-radius-lg);
    padding: 28px;
    animation: veloZoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Banner Container Layout */
.velo-pos-bottom_bar .velo-banner-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.velo-pos-bottom_left_box .velo-banner-container,
.velo-pos-bottom_right_box .velo-banner-container,
.velo-pos-modal_center .velo-banner-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.velo-banner-body {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex: 1;
}

/* Shield Pulse Badge */
.velo-shield-pulse {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--velo-radius-md);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(37, 99, 235, 0.15) 100%);
    border: 1px solid rgba(14, 165, 233, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--velo-accent);
}

.velo-shield-pulse .velo-icon {
    width: 22px;
    height: 22px;
}

.velo-banner-content-col {
    flex: 1;
}

.velo-banner-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.velo-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--velo-text-primary);
    letter-spacing: -0.01em;
}

/* Language Switcher Pills */
.velo-lang-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--velo-surface-card);
    border: 1px solid var(--velo-surface-border);
    border-radius: var(--velo-radius-full);
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
}

.velo-lang-btn {
    background: none;
    border: none;
    color: var(--velo-text-muted);
    padding: 3px 6px;
    cursor: pointer;
    border-radius: var(--velo-radius-full);
    transition: var(--velo-transition);
}

.velo-lang-btn:hover {
    color: var(--velo-text-primary);
}

.velo-lang-btn.active {
    background: var(--velo-accent-gradient);
    color: #ffffff;
}

.velo-lang-divider {
    color: var(--velo-surface-border);
    font-size: 10px;
    user-select: none;
}

.velo-banner-desc {
    margin: 0 0 10px 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--velo-text-secondary);
}

.velo-banner-legal-links {
    display: flex;
    gap: 14px;
    font-size: 12px;
}

.velo-legal-link {
    color: var(--velo-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: var(--velo-transition);
}

.velo-legal-link:hover {
    color: var(--velo-accent-hover);
    text-decoration: none;
}

/* Action Buttons Container */
.velo-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.velo-pos-bottom_left_box .velo-banner-actions,
.velo-pos-bottom_right_box .velo-banner-actions,
.velo-pos-modal_center .velo-banner-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.velo-pos-bottom_left_box .velo-btn-primary,
.velo-pos-bottom_right_box .velo-btn-primary,
.velo-pos-modal_center .velo-btn-primary {
    grid-column: span 2;
}

/* Standard Button Styles */
.velo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    font-family: var(--velo-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--velo-radius-md);
    cursor: pointer;
    transition: var(--velo-transition);
    white-space: nowrap;
    text-decoration: none;
    border: none;
    outline: none;
}

.velo-btn-primary {
    background: var(--velo-accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.velo-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--velo-accent-glow), 0 6px 20px rgba(14, 165, 233, 0.45);
}

.velo-btn-secondary {
    background: var(--velo-surface-card);
    color: var(--velo-text-primary);
    border: 1px solid var(--velo-surface-border);
}

.velo-btn-secondary:hover {
    background: var(--velo-surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.velo-theme-light .velo-btn-secondary:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.velo-btn-ghost {
    background: transparent;
    color: var(--velo-text-muted);
    border: 1px solid transparent;
}

.velo-btn-ghost:hover {
    color: var(--velo-accent);
    background: var(--velo-surface-hover);
    border-color: var(--velo-surface-border);
}

/* -------------------------------------------------------------
 * 2. PREFERENCES MODAL
 * ----------------------------------------------------------- */
.velo-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: veloFadeIn 0.25s ease-out forwards;
}

.velo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.velo-modal-card {
    position: relative;
    z-index: 2;
    background: var(--velo-bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--velo-border-glass);
    box-shadow: var(--velo-shadow);
    border-radius: var(--velo-radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: veloZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Modal Header */
.velo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px 18px 26px;
    border-bottom: 1px solid var(--velo-border-glass);
}

.velo-badge-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--velo-accent);
    margin-bottom: 4px;
}

.velo-modal-heading {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--velo-text-primary);
}

.velo-modal-close {
    background: var(--velo-surface-card);
    border: 1px solid var(--velo-surface-border);
    color: var(--velo-text-muted);
    border-radius: var(--velo-radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--velo-transition);
}

.velo-modal-close:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

/* Modal Body */
.velo-modal-body {
    padding: 20px 26px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.velo-modal-intro {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--velo-text-secondary);
}

/* Category Items */
.velo-cat-item {
    background: var(--velo-surface-card);
    border: 1px solid var(--velo-surface-border);
    border-radius: var(--velo-radius-md);
    padding: 16px 18px;
    transition: var(--velo-transition);
}

.velo-cat-item:hover {
    border-color: rgba(14, 165, 233, 0.3);
}

.velo-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.velo-cat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.velo-cat-icon {
    font-size: 18px;
}

.velo-cat-labels {
    display: flex;
    align-items: center;
    gap: 8px;
}

.velo-cat-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--velo-text-primary);
}

.velo-pill-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--velo-radius-full);
}

.velo-pill-always {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.velo-cat-desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--velo-text-muted);
}

/* Modern Switch Toggle */
.velo-switch-wrapper {
    position: relative;
    width: 44px;
    height: 24px;
}

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

.velo-toggle-label {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: var(--velo-radius-full);
    transition: var(--velo-transition);
}

.velo-theme-light .velo-toggle-label {
    background-color: rgba(0, 0, 0, 0.15);
}

.velo-toggle-label::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--velo-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.velo-toggle-input:checked + .velo-toggle-label {
    background: var(--velo-accent-gradient);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

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

.velo-toggle-disabled {
    cursor: not-allowed !important;
    opacity: 0.85;
}

/* Audit Token Box */
.velo-audit-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed var(--velo-surface-border);
    border-radius: var(--velo-radius-sm);
    font-size: 12px;
}

.velo-theme-light .velo-audit-box {
    background: rgba(0, 0, 0, 0.03);
}

.velo-audit-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--velo-text-muted);
}

.velo-audit-text code {
    font-family: monospace;
    font-size: 11px;
    color: var(--velo-accent);
    background: rgba(14, 165, 233, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Modal Footer */
.velo-modal-footer {
    padding: 16px 26px;
    border-top: 1px solid var(--velo-border-glass);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* -------------------------------------------------------------
 * 3. FLOATING REOPEN / REVOKE BADGE (PREMIUM COOKIE DOCK)
 * ----------------------------------------------------------- */
.velo-reopen-badge {
    position: fixed;
    z-index: 99999990;
    background: var(--velo-bg-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--velo-border-glass);
    box-shadow: var(--velo-shadow);
    cursor: pointer;
    transition: var(--velo-transition);
    display: flex;
    align-items: center;
    color: var(--velo-text-primary);
    text-decoration: none;
    outline: none;
}

/* Floating Middle-Left (Docked to screen left edge) */
.velo-badge-middle_left {
    top: 50% !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    border-radius: 0 16px 16px 0 !important;
    border-left: none !important;
    padding: 10px 14px 10px 10px !important;
    box-shadow: 4px 0 22px rgba(0, 0, 0, 0.45), 0 0 18px rgba(245, 158, 11, 0.25) !important;
    z-index: 999999999 !important;
}

.velo-badge-middle_left:hover {
    transform: translateY(-50%) translateX(6px) scale(1.04) !important;
    border-color: #f59e0b !important;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.55), 0 0 24px rgba(245, 158, 11, 0.5) !important;
}

/* Floating Middle-Right (Docked to screen right edge) */
.velo-badge-middle_right {
    top: 50% !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    border-radius: 16px 0 0 16px !important;
    border-right: none !important;
    padding: 10px 10px 10px 14px !important;
    box-shadow: -4px 0 22px rgba(0, 0, 0, 0.45), 0 0 18px rgba(245, 158, 11, 0.25) !important;
    z-index: 999999999 !important;
}

.velo-badge-middle_right:hover {
    transform: translateY(-50%) translateX(-6px) scale(1.04) !important;
    border-color: #f59e0b !important;
    box-shadow: -6px 0 28px rgba(0, 0, 0, 0.55), 0 0 24px rgba(245, 158, 11, 0.5) !important;
}

/* Floating Bottom Corners */
.velo-badge-bottom_left {
    bottom: 24px;
    left: 24px;
    border-radius: var(--velo-radius-full);
    padding: 8px 14px;
}

.velo-badge-bottom_left:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: #f59e0b;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.35);
}

.velo-badge-bottom_right {
    bottom: 24px;
    right: 24px;
    border-radius: var(--velo-radius-full);
    padding: 8px 14px;
}

.velo-badge-bottom_right:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: #f59e0b;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.35);
}

.velo-reopen-badge-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.velo-badge-cookie-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.velo-reopen-badge:hover .velo-badge-cookie-svg {
    transform: rotate(20deg) scale(1.18);
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.85));
}

.velo-badge-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* -------------------------------------------------------------
 * 4. KEYFRAME ANIMATIONS
 * ----------------------------------------------------------- */
@keyframes veloSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes veloZoomIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes veloFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* -------------------------------------------------------------
 * 5. RESPONSIVE MOBILE STYLES (< 768px)
 * ----------------------------------------------------------- */
@media (max-width: 768px) {
    .velo-pos-bottom_bar .velo-cookie-banner {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 18px;
    }

    .velo-pos-bottom_bar .velo-banner-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .velo-banner-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .velo-banner-actions .velo-btn-primary {
        grid-column: span 2;
    }

    .velo-modal-card {
        max-height: 95vh;
    }

    .velo-modal-header {
        padding: 16px 20px;
    }

    .velo-modal-body {
        padding: 16px 20px;
    }

    .velo-modal-footer {
        padding: 14px 20px;
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .velo-modal-footer .velo-btn {
        width: 100%;
    }

    .velo-reopen-badge {
        padding: 8px;
        border-radius: 50%;
    }

    .velo-badge-text {
        display: none;
    }
}
