/**
 * Cookie Consent Banner Styles
 * Compatible with silktideCookieBannerManager API
 */

/* CSS Variables for easy theming */
:root {
    --cc-bg: #1a1a2e;
    --cc-text: #e0e0e0;
    --cc-btn-primary-bg: linear-gradient(135deg, #6366f1, #8b5cf6);
    --cc-btn-primary-text: #ffffff;
    --cc-btn-secondary-bg: rgba(99, 102, 241, 0.15);
    --cc-btn-secondary-text: #a5b4fc;
    --cc-btn-secondary-border: rgba(99, 102, 241, 0.4);
    --cc-overlay-bg: rgba(0, 0, 0, 0.7);
    --cc-border-color: rgba(99, 102, 241, 0.3);
    --cc-toggle-on: #6366f1;
    --cc-toggle-off: #4b5563;
    --cc-link-color: #818cf8;
}

/* Overlay Background */
.cc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cc-overlay-bg);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cc-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Banner Container */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--cc-bg);
    border-top: 1px solid var(--cc-border-color);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.cc-banner-text {
    flex: 1;
    min-width: 280px;
    color: var(--cc-text);
    font-size: 14px;
    line-height: 1.6;
}

.cc-banner-text a {
    color: var(--cc-link-color);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cc-banner-text a:hover {
    color: #a5b4fc;
}

.cc-banner-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Buttons */
.cc-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;
}

.cc-btn-primary {
    background: var(--cc-btn-primary-bg);
    color: var(--cc-btn-primary-text);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.cc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.cc-btn-secondary {
    background: var(--cc-btn-secondary-bg);
    color: var(--cc-btn-secondary-text);
    border: 1px solid var(--cc-btn-secondary-border);
}

.cc-btn-secondary:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.6);
}

.cc-btn-link {
    background: transparent;
    color: var(--cc-btn-secondary-text);
    padding: 12px 16px;
}

.cc-btn-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Reject button - less prominent styling */
.cc-reject-nonessential {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 12px;
    padding: 8px 12px;
    opacity: 0.7;
    text-decoration: underline;
    font-weight: 400;
}

.cc-reject-nonessential:hover {
    background: transparent;
    border: none;
    color: #9ca3af;
    opacity: 1;
}

/* Preferences Modal */
.cc-preferences {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--cc-bg);
    border: 1px solid var(--cc-border-color);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    z-index: 100000;
    max-width: 600px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-preferences.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.cc-preferences-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--cc-border-color);
}

.cc-preferences-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.cc-preferences-description {
    color: var(--cc-text);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

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

/* Cookie Type Items */
.cc-cookie-type {
    padding: 16px 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

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

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

.cc-cookie-type-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.cc-cookie-type-description {
    color: var(--cc-text);
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.85;
}

/* Toggle Switch */
.cc-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

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

.cc-toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

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

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

.cc-toggle input:disabled+.cc-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cc-toggle-required {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* Preferences Footer */
.cc-preferences-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-top: 1px solid var(--cc-border-color);
}

.cc-preferences-actions {
    display: flex;
    gap: 12px;
}

.cc-credit-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cc-credit-link:hover {
    color: var(--cc-link-color);
}

/* Cookie Icon Button */
.cc-icon-btn {
    position: fixed;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--cc-btn-primary-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    z-index: 99997;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.cc-icon-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.cc-icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.cc-icon-btn.bottomLeft {
    left: 20px;
}

.cc-icon-btn.bottomRight {
    right: 20px;
}

.cc-icon-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Responsive */
@media (max-width: 768px) {
    .cc-banner-inner {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .cc-banner-buttons {
        width: 100%;
        justify-content: center;
    }

    .cc-btn {
        flex: 1;
        min-width: 120px;
    }

    .cc-preferences {
        width: calc(100% - 24px);
        max-height: calc(100vh - 40px);
    }

    .cc-preferences-footer {
        flex-direction: column;
        text-align: center;
    }

    .cc-preferences-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes cc-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(99, 102, 241, 0.6);
    }
}

.cc-icon-btn.visible {
    animation: cc-pulse 2s ease-in-out infinite;
}