/**
 * Cookie Consent Banner Styles
 * Clean, modern design that works with Cinemdle's theme
 */

/* Banner */
#cookie-consent-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-top: 2px solid #6B46C1;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    padding: 20px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-text h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.cookie-consent-text p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #ccc;
}

.cookie-consent-links {
    font-size: 13px;
}

.cookie-consent-links a {
    color: #6B46C1;
    text-decoration: none;
}

.cookie-consent-links a:hover {
    text-decoration: underline;
}

.cookie-consent-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

.cookie-btn-primary {
    background: #6B46C1;
    color: #fff;
}

.cookie-btn-primary:hover {
    background: #5a3aa1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.cookie-btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #444;
}

.cookie-btn-secondary:hover {
    border-color: #6B46C1;
    background: rgba(107, 70, 193, 0.1);
}

.cookie-btn-link {
    background: transparent;
    color: #6B46C1;
    text-decoration: underline;
}

.cookie-btn-link:hover {
    color: #8B66E1;
}

/* Settings Modal */
#cookie-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
}

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

.cookie-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border: 2px solid #6B46C1;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cookie-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.cookie-modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: #fff;
}

/* Settings Sections */
.cookie-settings-section {
    margin-bottom: 24px;
}

.cookie-setting-item {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.cookie-setting-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cookie-setting-item h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    flex: 1;
}

.cookie-setting-item p {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #ccc;
    line-height: 1.5;
}

.cookie-setting-item small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.cookie-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #6B46C1;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

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

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: 0.3s;
    border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #6B46C1;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Buttons */
.cookie-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.cookie-modal-buttons .cookie-btn {
    flex: 1;
    min-width: 140px;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    #cookie-consent-banner {
        padding: 14px;
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }

    .cookie-consent-content {
        flex-direction: column;
        gap: 14px;
    }

    .cookie-consent-text {
        min-width: 100%;
    }

    .cookie-consent-text h3 {
        font-size: 15px;
    }

    .cookie-consent-text p {
        font-size: 13px;
    }

    .cookie-consent-links {
        font-size: 12px;
    }

    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        min-height: 48px;
        padding: 12px 18px;
        font-size: 14px;
    }

    .cookie-modal-content {
        width: 92%;
        padding: 20px 16px;
        max-height: 80vh;
        border-radius: 8px;
    }

    .cookie-modal-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .cookie-modal-content h2 {
        font-size: 16px;
        margin-bottom: 16px;
        padding-right: 36px;
    }

    .cookie-setting-item {
        padding: 14px;
        margin-bottom: 10px;
    }

    .cookie-setting-item h3 {
        font-size: 14px;
    }

    .cookie-setting-item p {
        font-size: 13px;
    }

    .cookie-modal-buttons {
        flex-direction: column;
    }

    .cookie-modal-buttons .cookie-btn {
        width: 100%;
    }
}

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {
    .cookie-btn {
        touch-action: manipulation;
        min-height: 44px;
    }

    .cookie-toggle {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .cookie-modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    #cookie-consent-banner {
        border-top: 3px solid #fff;
    }

    .cookie-btn-primary {
        border: 2px solid #fff;
    }

    .cookie-setting-item {
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #cookie-consent-banner,
    .cookie-modal-content {
        animation: none;
    }

    .cookie-btn {
        transition: none;
    }
}
