/**
 * GDPR Consent Banner - Frontend Styles
 * Premium Dark Indigo Theme (CIVIC Style)
 * 
 * @version 1.1.0
 */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* CSS Variables */
:root {
    --gdpr-color-bg: #1d2038;
    --gdpr-color-text: #ffffff;
    --gdpr-color-text-muted: #d0d3e3;
    --gdpr-color-divider: #2c2f48;
    --gdpr-color-toggle-bg: #161829;
    --gdpr-color-toggle-active: #2e3561;
    --gdpr-color-toggle-border: #282b45;
    --gdpr-color-toggle-thumb-off: #2f3560;
    --gdpr-color-toggle-thumb-on: #ffffff;
    --gdpr-color-toggle-text-off: #8e94b2;
    --gdpr-color-toggle-text-on: #ffffff;
    --gdpr-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --gdpr-z-index: 99999999;
}

/* Reset and Container Styling */
.gdpr-consent-banner *,
.gdpr-consent-banner *::before,
.gdpr-consent-banner *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Overlay */
.gdpr-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: calc(var(--gdpr-z-index) - 1);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gdpr-overlay.gdpr-active {
    display: block;
    opacity: 1;
}

/* Base Banner Panel */
.gdpr-consent-banner {
    position: fixed;
    background-color: var(--gdpr-color-bg);
    color: var(--gdpr-color-text);
    z-index: var(--gdpr-z-index);
    font-family: var(--gdpr-font-family);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.35);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

/* Position: Left Panel (Default Style matching CIVIC) */
.gdpr-consent-banner.gdpr-position-left-panel {
    top: 0;
    bottom: 0;
    left: 0;
    width: 380px;
    height: 100vh;
    transform: translateX(-100%);
    border-radius: 0;
}

.gdpr-consent-banner.gdpr-position-left-panel.gdpr-active {
    transform: translateX(0);
}

/* Position: Bottom Bar */
.gdpr-consent-banner.gdpr-position-bottom {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    transform: translateY(100%);
    border-radius: 12px 12px 0 0;
}

.gdpr-consent-banner.gdpr-position-bottom.gdpr-active {
    transform: translateY(0);
}

/* Position: Top Bar */
.gdpr-consent-banner.gdpr-position-top {
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    max-height: 85vh;
    transform: translateY(-100%);
    border-radius: 0 0 12px 12px;
}

.gdpr-consent-banner.gdpr-position-top.gdpr-active {
    transform: translateY(0);
}

/* Position: Center Modal */
.gdpr-consent-banner.gdpr-position-center {
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    border-radius: 8px;
}

.gdpr-consent-banner.gdpr-position-center.gdpr-active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Banner Inner Padding */
.gdpr-banner-inner {
    height: 100%;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Scrollbar styling for inner panel */
.gdpr-banner-inner::-webkit-scrollbar {
    width: 6px;
}
.gdpr-banner-inner::-webkit-scrollbar-track {
    background: transparent;
}
.gdpr-banner-inner::-webkit-scrollbar-thumb {
    background-color: var(--gdpr-color-divider);
    border-radius: 3px;
}

/* Header & Title */
.gdpr-banner-header {
    margin-bottom: 15px;
}

.gdpr-banner-header h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--gdpr-color-text);
}

/* Description Text */
.gdpr-banner-description {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--gdpr-color-text-muted);
    margin-bottom: 20px;
}

.gdpr-banner-description p {
    margin-bottom: 12px;
}

/* Cookie Policy link paragraph */
.gdpr-policy-link-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 0;
    font-weight: 600;
}

.gdpr-cookie-policy-link {
    color: var(--gdpr-color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gdpr-cookie-policy-link:hover {
    opacity: 0.85;
}

.gdpr-external-link-icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Divider Lines */
.gdpr-divider {
    border: 0;
    height: 1px;
    background-color: var(--gdpr-color-divider);
    margin: 15px 0;
    flex-shrink: 0;
}

/* Categories List */
.gdpr-consent-categories {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gdpr-category {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.gdpr-category-info {
    flex-grow: 1;
}

.gdpr-category-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gdpr-color-text);
    margin-bottom: 6px;
}

.gdpr-category-info p {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--gdpr-color-text-muted);
}

/* Pill Toggle Switch Design */
.gdpr-toggle {
    position: relative;
    display: inline-block;
    width: 68px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

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

.gdpr-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gdpr-color-toggle-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    border-radius: 28px;
    border: 1px solid var(--gdpr-color-toggle-border);
}

/* ON state track style */
.gdpr-toggle input:checked + .gdpr-toggle-slider {
    background-color: var(--gdpr-color-toggle-active);
    border-color: var(--gdpr-color-toggle-active);
}

/* Circular Thumb */
.gdpr-toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--gdpr-color-toggle-thumb-off);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease;
    border-radius: 50%;
    z-index: 2;
}

/* ON state thumb translation and color */
.gdpr-toggle input:checked + .gdpr-toggle-slider::before {
    transform: translateX(40px);
    background-color: var(--gdpr-color-toggle-thumb-on);
}

/* Track Labels (On / Off) */
.gdpr-toggle-slider::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

/* OFF state label settings */
.gdpr-toggle-slider::after {
    content: "Off";
    right: 10px;
    color: var(--gdpr-color-toggle-text-off);
}

/* ON state label settings */
.gdpr-toggle input:checked + .gdpr-toggle-slider::after {
    content: "On";
    left: 12px;
    right: auto;
    color: var(--gdpr-color-toggle-text-on);
}

/* Buttons Styling */
.gdpr-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    outline: none;
}

.gdpr-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Accept all cookies (Outline style above the line) */
.gdpr-btn-accept-all {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
    width: 100%;
    text-align: center;
}

.gdpr-btn-accept-all:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Reject all cookies (Outline style if shown) */
.gdpr-btn-reject-all {
    background-color: transparent;
    color: var(--gdpr-color-text-muted);
    border: 1px solid var(--gdpr-color-divider);
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.gdpr-btn-reject-all:hover {
    border-color: #ffffff;
    color: #ffffff;
}

/* Close Cookie Control (Solid white button at the bottom) */
.gdpr-btn-close {
    background-color: #ffffff;
    color: #121528;
    border: none;
    width: auto;
    min-width: 180px;
    text-align: center;
}

.gdpr-btn-close:hover {
    background-color: #f1f2f6;
}

.gdpr-banner-actions-bottom {
    margin-top: 10px;
    flex-shrink: 0;
}

/* Reopen Button Tab (Bottom-Left Corner Tab) */
.gdpr-reopen-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 48px;
    background-color: var(--gdpr-color-bg);
    border-radius: 0 4px 0 0;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 2px -2px 10px rgba(0, 0, 0, 0.2);
    z-index: calc(var(--gdpr-z-index) - 2);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gdpr-reopen-consent:hover {
    background-color: var(--gdpr-color-toggle-active);
    transform: scale(1.05);
}

.gdpr-reopen-consent.gdpr-active {
    display: flex;
}

/* Responsive Styles for Mobile */
@media (max-width: 480px) {
    .gdpr-consent-banner.gdpr-position-left-panel {
        width: 100%;
        max-width: 100%;
    }
    .gdpr-banner-inner {
        padding: 24px 20px;
    }
}

/* Print layout settings */
@media print {
    .gdpr-consent-banner,
    .gdpr-overlay,
    .gdpr-reopen-consent {
        display: none !important;
    }
}
