/**
 * NuageLab Cookie Consent Banner
 * Mobile-first responsive design
 * Uses CookieYes-compatible .cky-* class naming
 */

/* Base styles */
.cky-consent-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    box-sizing: border-box;
    z-index: 999999;
}

.cky-consent-container *,
.cky-consent-container *::before,
.cky-consent-container *::after {
    box-sizing: border-box;
}

/* Bar style (full-width) */
.cky-consent-bar {
    position: fixed;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 16px;
}

.cky-consent-bar.cky-bottom {
    bottom: 0;
}

.cky-consent-bar.cky-top {
    top: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Popup style (centered modal) */
.cky-consent-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
}

.cky-consent-popup::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Floating style (corner positioned) */
.cky-consent-floating {
    position: fixed;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    width: calc(100% - 32px);
    margin: 16px;
}

.cky-consent-floating.cky-bottom-left {
    bottom: 0;
    left: 0;
}

.cky-consent-floating.cky-bottom-right {
    bottom: 0;
    right: 0;
}

.cky-consent-floating.cky-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Content layout */
.cky-notice {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cky-notice-wrapper {
    flex: 1;
}

.cky-notice-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1d2327;
}

.cky-notice-des {
    margin: 0;
    color: #50575e;
}

/* Action buttons */
.cky-notice-btn-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cky-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.cky-btn-accept {
    background: #2271b1;
    color: #fff;
}

.cky-btn-accept:hover {
    background: #135e96;
}

.cky-btn-reject {
    background: #f0f0f1;
    color: #50575e;
    border: 1px solid #c3c4c7;
}

.cky-btn-reject:hover {
    background: #e0e0e0;
}

.cky-btn-customize {
    background: transparent;
    color: #2271b1;
    text-decoration: underline;
}

.cky-btn-customize:hover {
    color: #135e96;
}

.cky-btn-save {
    background: #00a32a;
    color: #fff;
    width: 100%;
}

.cky-btn-save:hover {
    background: #008a20;
}

/* Customize panel */
.cky-preference-center {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.cky-preference-body-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.cky-accordion-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.cky-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cky-accordion-header-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.cky-accordion-header-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2271b1;
}

.cky-accordion-header-toggle input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.cky-accordion-title {
    color: #1d2327;
}

.cky-always-active {
    font-size: 12px;
    font-weight: 400;
    color: #00a32a;
    background: #d4edda;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: auto;
}

.cky-accordion-body {
    margin: 8px 0 0;
    font-size: 13px;
    color: #646970;
}

.cky-preference-footer {
    margin-top: 16px;
}

/* Animation */
.cky-consent-container {
    animation: ckySlideIn 0.3s ease-out;
}

@keyframes ckySlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cky-consent-popup {
    animation: ckyFadeIn 0.3s ease-out;
}

@keyframes ckyFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Desktop styles */
@media (min-width: 768px) {
    .cky-consent-bar .cky-notice {
        flex-direction: row;
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
    }

    .cky-consent-bar .cky-notice-btn-wrapper {
        flex-shrink: 0;
    }

    .cky-btn {
        min-width: 120px;
    }

    .cky-btn-customize {
        min-width: auto;
    }
}

/* Accessibility */
.cky-consent-container:focus-within {
    outline: none;
}

.cky-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.cky-accordion-header-toggle input[type="checkbox"]:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cky-consent-container {
        border: 2px solid #000;
    }

    .cky-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cky-consent-container,
    .cky-consent-popup {
        animation: none;
    }

    .cky-btn {
        transition: none;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .cky-consent-container {
        background: #1e1e1e;
        color: #e0e0e0;
    }

    .cky-notice-title {
        color: #fff;
    }

    .cky-notice-des {
        color: #b0b0b0;
    }

    .cky-accordion-item {
        background: #2d2d2d;
    }

    .cky-accordion-title {
        color: #fff;
    }

    .cky-accordion-body {
        color: #a0a0a0;
    }

    .cky-btn-reject {
        background: #333;
        color: #e0e0e0;
        border-color: #555;
    }

    .cky-btn-reject:hover {
        background: #444;
    }

    .cky-preference-center {
        border-top-color: #444;
    }
}
