/**
 * Cookie Consent Banner Styles
 * Handoff Labs - GDPR Compliant Cookie Consent UI
 */

/* GDPR Compliant Blocking Banner */
.hl-cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Blocking Overlay Background */
.hl-cookie-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(8px);
    z-index: -1;
}

/* Banner Container */
.hl-cookie-banner-container {
    background: rgba(254, 250, 246, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 122, 120, 0.2);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.hl-cookie-banner--visible {
    opacity: 1;
    visibility: visible;
}

.hl-cookie-banner--visible .hl-cookie-banner-container {
    transform: scale(1);
}

.hl-cookie-banner__content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hl-cookie-banner__header {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    justify-content: start;
}

.hl-cookie-banner__body {
    text-align: left;
}

.hl-cookie-banner__footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Block scrolling when banner is shown */
.hl-cookie-consent-blocking {
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* Temporary hiding for policy reading */
.hl-cookie-banner.hl-temporary-hidden {
    display: none !important;
}

/* Slim banner for policy pages */
.hl-cookie-banner.hl-slim-mode {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: block;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 1;
    visibility: visible;
    background: transparent;
}

.hl-cookie-banner.hl-slim-mode::before {
    display: none;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner-container {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 0;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.25);
    max-width: none;
    width: 100%;
    max-height: none;
    transform: scale(1);
    margin: 0;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner__content {
    padding: 16px 24px;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner__header {
    gap: 12px;
    text-align: left;
    justify-content: flex-start;
    margin: 0;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner__header h2 {
    font-size: 1rem !important;
    color: white !important;
    margin: 0 !important;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner__body {
    text-align: left;
    flex: 1;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner__body p {
    color: #CBD5E1 !important;
    font-size: 0.875rem !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner__footer {
    flex-direction: row;
    gap: 8px;
    margin: 0;
}

.hl-cookie-banner.hl-slim-mode .hl-cookie-banner__footer .hl-btn {
    width: auto !important;
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
    min-height: auto !important;
}

/* No body blocking for policy pages */
body.hl-policy-page .hl-cookie-consent-blocking {
    overflow: auto !important;
    height: auto !important;
    position: static !important;
    width: auto !important;
}

body.hl-policy-page {
    padding-bottom: 120px; /* Space for slim banner */
}

.hl-cookie-banner__icon {
    font-size: 2rem;
    line-height: 1;
}

.hl-cookie-banner__text h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
}

.hl-cookie-banner__text p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #64748B;
    line-height: 1.5;
}

.hl-cookie-banner__links {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.hl-cookie-banner__links a {
    font-size: 0.85rem;
    color: #007A78;
    text-decoration: none;
    font-weight: 500;
}

.hl-cookie-banner__links a:hover {
    text-decoration: underline;
}

.hl-cookie-banner__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Button styles */
.hl-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    white-space: nowrap;
}

.hl-btn--primary {
    background: linear-gradient(135deg, #007A78 0%, #00A8A5 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 122, 120, 0.2);
}

.hl-btn--primary:hover {
    background: linear-gradient(135deg, #005F5D 0%, #007A78 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 120, 0.3);
}

.hl-btn--secondary {
    background: #F1F5F9;
    color: #1E293B;
    border: 1px solid #E2E8F0;
}

.hl-btn--secondary:hover {
    background: #E2E8F0;
    border-color: #CBD5E1;
}

.hl-btn--outline {
    background: transparent;
    border: 1px solid #CBD5E1;
}

.hl-btn--outline:hover {
    background: #F8FAFC;
    color: #1E293B;
    border-color: #94A3B8;
}

/* Modal styles */
.hl-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hl-cookie-modal--visible {
    opacity: 1;
    visibility: visible;
}

.hl-cookie-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.hl-cookie-modal__content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.hl-cookie-modal--visible .hl-cookie-modal__content {
    transform: scale(1);
}

.hl-cookie-modal__header {
    padding: 24px 24px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #F1F5F9;
    padding-bottom: 20px;
}

.hl-cookie-modal__header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1E293B;
}

.hl-cookie-modal__close {
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hl-cookie-modal__close:hover {
    background: #F1F5F9;
    color: #1E293B;
}

.hl-cookie-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.hl-cookie-modal__description {
    margin: 0 0 24px 0;
    color: #64748B;
    line-height: 1.6;
}

.hl-cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hl-cookie-category {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
}

.hl-cookie-category__header {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.hl-cookie-category__info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
}

.hl-cookie-category__info p {
    margin: 0;
    color: #64748B;
    font-size: 0.9rem;
    line-height: 1.5;
}

.hl-cookie-category__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Toggle switch */
.hl-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.hl-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.hl-toggle__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1;
    transition: 0.3s;
    border-radius: 26px;
}

.hl-toggle__slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hl-toggle input:checked + .hl-toggle__slider {
    background-color: #007A78;
}

.hl-toggle input:checked + .hl-toggle__slider:before {
    transform: translateX(24px);
}

.hl-toggle input:disabled + .hl-toggle__slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.hl-badge {
    background: #FEF3C7;
    color: #92400E;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.hl-cookie-category__details {
    border-top: 1px solid #F1F5F9;
    padding: 16px 20px;
    background: #F8FAFC;
}

.hl-cookie-category__details details summary {
    cursor: pointer;
    font-weight: 500;
    color: #007A78;
    font-size: 0.9rem;
}

.hl-cookie-category__details details[open] summary {
    margin-bottom: 12px;
}

.hl-cookie-scripts h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1E293B;
}

.hl-cookie-scripts ul {
    margin: 0;
    padding-left: 20px;
    color: #64748B;
    font-size: 0.85rem;
}

.hl-cookie-scripts li {
    margin-bottom: 4px;
}

.hl-cookie-modal__footer {
    padding: 20px 24px 24px 24px;
    border-top: 1px solid #F1F5F9;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Body modifications when banner/modal is shown */
.hl-cookie-banner-shown {
    padding-bottom: 160px; /* Adjust based on banner height */
}

.hl-modal-open {
    overflow: hidden;
}

/* Responsive design */
@media (max-width: 768px) {
    .hl-cookie-banner__content {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: left;
        padding: 16px 20px;
    }

    .hl-cookie-banner__actions {
        justify-content: center;
        gap: 8px;
    }

    .hl-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
        min-width: 100px;
    }

    .hl-cookie-modal {
        padding: 10px;
    }

    .hl-cookie-modal__content {
        max-height: 95vh;
    }

    .hl-cookie-modal__header {
        padding: 20px 20px 0 20px;
    }

    .hl-cookie-modal__body {
        padding: 20px;
    }

    .hl-cookie-modal__footer {
        padding: 16px 20px 20px 20px;
        flex-direction: column;
    }

    .hl-cookie-modal__footer .hl-btn {
        width: 100%;
    }

    .hl-cookie-category__header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .hl-cookie-category__toggle {
        align-self: stretch;
        justify-content: space-between;
    }

    .hl-cookie-banner-shown {
        padding-bottom: 200px; /* More space on mobile */
    }
}

@media (max-width: 480px) {
    .hl-cookie-banner__text h3 {
        font-size: 1rem;
    }

    .hl-cookie-banner__text p {
        font-size: 0.85rem;
    }

    .hl-cookie-banner__links {
        flex-direction: column;
        gap: 8px;
    }

    .hl-cookie-modal__header h2 {
        font-size: 1.2rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .hl-cookie-banner,
    .hl-cookie-modal,
    .hl-cookie-modal__content,
    .hl-toggle__slider,
    .hl-toggle__slider:before,
    .hl-btn {
        transition: none;
    }
}

/* Focus styles for accessibility */
.hl-btn:focus,
.hl-toggle input:focus + .hl-toggle__slider,
.hl-cookie-modal__close:focus {
    outline: 2px solid #007A78;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hl-cookie-banner {
        border-top: 2px solid #000;
    }
    
    .hl-cookie-category {
        border: 2px solid #000;
    }
    
    .hl-btn--outline {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .hl-cookie-banner,
    .hl-cookie-modal {
        display: none !important;
    }
}
