/* =================================================================
   Cookie Consent - Frontend Styles
   EU GDPR / ePrivacy Compliant Banner
   ================================================================= */

:root {
    --cc-bg: #1e1e2e;
    --cc-text: #ffffff;
    --cc-btn-accept: #4CAF50;
    --cc-btn-reject: #f44336;
    --cc-btn-custom: #2196F3;
    --cc-border-radius: 8px;
    --cc-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    --cc-z-index: 99999;
    --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --cc-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --cc-modal-bg: #ffffff;
    --cc-modal-text: #333333;
    --cc-modal-border: #e5e7eb;
    --cc-toggle-on: #4CAF50;
    --cc-toggle-off: #9ca3af;
}

/* ── Container ── */
#cc-container {
    font-family: var(--cc-font);
    font-size: 14px;
    line-height: 1.5;
    z-index: var(--cc-z-index);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
}

#cc-container * {
    box-sizing: border-box;
}

/* ── Positions ── */
#cc-container.cc-position-top {
    bottom: auto;
    top: 0;
}

#cc-container.cc-position-bottom-left {
    left: 16px;
    right: auto;
    bottom: 16px;
    max-width: 420px;
    border-radius: var(--cc-border-radius);
}

#cc-container.cc-position-bottom-right {
    left: auto;
    right: 16px;
    bottom: 16px;
    max-width: 420px;
    border-radius: var(--cc-border-radius);
}

#cc-container.cc-position-center {
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

#cc-container.cc-position-center #cc-banner {
    pointer-events: all;
    max-width: 560px;
    border-radius: var(--cc-border-radius);
    width: 90%;
    margin: auto;
}

/* ── Overlay ── */
.cc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--cc-z-index) - 1);
}

/* ── Banner ── */
#cc-banner {
    background: var(--cc-bg);
    color: var(--cc-text);
    box-shadow: var(--cc-shadow);
    transform: translateY(100%);
    transition: transform var(--cc-transition);
    padding: 0;
}

#cc-container.cc-position-top #cc-banner {
    transform: translateY(-100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#cc-container.cc-visible #cc-banner {
    transform: translateY(0);
}

.cc-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* ── Banner text ── */
.cc-banner-text {
    flex: 1;
    min-width: 200px;
}

.cc-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cc-text);
}

.cc-description {
    margin: 0 0 8px 0;
    font-size: 13px;
    opacity: 0.9;
    color: var(--cc-text);
}

.cc-links {
    font-size: 12px;
}

.cc-links a {
    color: var(--cc-text);
    opacity: 0.75;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.cc-links a:hover {
    opacity: 1;
}

/* ── Banner Actions ── */
.cc-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
    white-space: nowrap;
    font-family: var(--cc-font);
    letter-spacing: 0.02em;
}

.cc-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.cc-btn:active {
    transform: translateY(0);
}

.cc-btn-accept {
    background: var(--cc-btn-accept);
    color: #fff;
}

.cc-btn-reject {
    background: var(--cc-btn-reject);
    color: #fff;
}

.cc-btn-custom {
    background: var(--cc-btn-custom);
    color: #fff;
}

/* ── Layout Box ── */
#cc-container.cc-layout-box #cc-banner {
    border-radius: var(--cc-border-radius);
}

#cc-container.cc-layout-box .cc-banner-inner {
    flex-direction: column;
    align-items: flex-start;
}

/* ── Modal ── */
.cc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--cc-z-index) + 10);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cc-modal {
    display: flex;
}

.cc-modal[hidden] {
    display: none !important;
}

.cc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    cursor: pointer;
}

.cc-modal-box {
    position: relative;
    background: var(--cc-modal-bg);
    color: var(--cc-modal-text);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: cc-modal-in 0.3s ease;
}

@keyframes cc-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--cc-modal-border);
}

.cc-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--cc-modal-text);
}

.cc-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-modal-close:hover {
    color: #111;
    background: #f3f4f6;
}

.cc-modal-body {
    padding: 16px 24px;
}

.cc-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--cc-modal-border);
    flex-wrap: wrap;
}

/* ── Category ── */
.cc-category {
    border: 1px solid var(--cc-modal-border);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.cc-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 16px;
}

.cc-category-info {
    flex: 1;
}

.cc-category-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--cc-modal-text);
    margin-bottom: 4px;
}

.cc-category-info p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.cc-category-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cc-always-on {
    font-size: 11px;
    color: #4CAF50;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Toggle Switch (frontend) ── */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cc-toggle-off);
    border-radius: 24px;
    transition: background 0.3s;
}

.cc-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.cc-switch input:checked + .cc-slider {
    background: var(--cc-toggle-on);
}

.cc-switch input:checked + .cc-slider::before {
    transform: translateX(20px);
}

.cc-switch-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Accessibility ── */
#cc-banner:focus-within,
.cc-modal-box:focus-within {
    outline: none;
}

.cc-btn:focus-visible {
    outline: 3px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

/* ── Animations ── */
#cc-container.cc-hidden #cc-banner {
    transform: translateY(100%);
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cc-banner-inner {
        flex-direction: column;
        padding: 14px 16px;
    }

    .cc-banner-actions {
        width: 100%;
        justify-content: stretch;
    }

    .cc-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 14px;
        font-size: 13px;
    }

    .cc-modal-box {
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
        margin-top: auto;
    }

    .cc-modal {
        align-items: flex-end;
        padding: 0;
    }

    .cc-modal-footer {
        flex-direction: column;
    }

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

/* ── Re-open button (floating) ── */
#cc-reopen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: calc(var(--cc-z-index) - 1);
    background: var(--cc-bg);
    color: var(--cc-text);
    border: none;
    border-radius: 50px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--cc-font);
}

#cc-reopen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

#cc-reopen-btn svg {
    width: 16px;
    height: 16px;
}
