/**
 * Lionate Digital - Cookie Banner Styles
 *
 * @package LionateDigital
 */

/* CSS Variables (set by PHP) */
:root {
    --lionate-bg-color: #1a1a2e;
    --lionate-text-color: #ffffff;
    --lionate-primary-btn-bg: #4f46e5;
    --lionate-primary-btn-text: #ffffff;
    --lionate-secondary-btn-bg: #374151;
    --lionate-secondary-btn-text: #ffffff;
    --lionate-border-radius: 8px;
    --lionate-font-size: 14px;
}

/* Cookie Banner Base */
.lionate-cookie-banner {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: var(--lionate-font-size);
    line-height: 1.5;
    box-sizing: border-box;
}

.lionate-cookie-banner *,
.lionate-cookie-banner *::before,
.lionate-cookie-banner *::after {
    box-sizing: border-box;
}

/* Position Variants */
.lionate-banner-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0;
}

.lionate-banner-top {
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
}

.lionate-banner-bottom-left {
    bottom: 20px;
    left: 20px;
    max-width: 400px;
}

.lionate-banner-bottom-right {
    bottom: 20px;
    right: 20px;
    max-width: 400px;
}

.lionate-banner-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: calc(100% - 40px);
}

/* Banner Content */
.lionate-banner-content {
    background-color: var(--lionate-bg-color);
    color: var(--lionate-text-color);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: var(--lionate-border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Full width bars */
.lionate-banner-bottom .lionate-banner-content,
.lionate-banner-top .lionate-banner-content {
    border-radius: 0;
}

/* Corner popups */
.lionate-banner-bottom-left .lionate-banner-content,
.lionate-banner-bottom-right .lionate-banner-content {
    flex-direction: column;
    align-items: flex-start;
}

/* Center modal */
.lionate-banner-center .lionate-banner-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
}

/* Banner Text */
.lionate-banner-text {
    flex: 1;
    min-width: 280px;
}

.lionate-banner-headline {
    margin: 0 0 0.5rem;
    font-size: 1.125em;
    font-weight: 600;
}

.lionate-banner-message {
    margin: 0;
    opacity: 0.9;
}

.lionate-learn-more {
    color: var(--lionate-primary-btn-bg);
    text-decoration: underline;
    margin-left: 0.5rem;
    font-weight: 500;
}

.lionate-learn-more:hover {
    opacity: 0.8;
}

/* Banner Actions */
.lionate-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.lionate-banner-bottom-left .lionate-banner-actions,
.lionate-banner-bottom-right .lionate-banner-actions,
.lionate-banner-center .lionate-banner-actions {
    width: 100%;
}

/* Buttons */
.lionate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: var(--lionate-font-size);
    font-weight: 500;
    line-height: 1.4;
    border: none;
    border-radius: calc(var(--lionate-border-radius) * 0.75);
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.lionate-btn:hover {
    opacity: 0.9;
}

.lionate-btn:active {
    transform: scale(0.98);
}

.lionate-btn:focus {
    outline: 2px solid var(--lionate-primary-btn-bg);
    outline-offset: 2px;
}

.lionate-btn-primary {
    background-color: var(--lionate-primary-btn-bg);
    color: var(--lionate-primary-btn-text);
}

.lionate-btn-secondary {
    background-color: var(--lionate-secondary-btn-bg);
    color: var(--lionate-secondary-btn-text);
}

/* Cookie Settings Modal */
.lionate-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.lionate-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.lionate-modal-content {
    position: relative;
    background-color: var(--lionate-bg-color);
    color: var(--lionate-text-color);
    border-radius: var(--lionate-border-radius);
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Modal Header */
.lionate-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lionate-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.lionate-modal-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--lionate-text-color);
    opacity: 0.7;
    transition: opacity 0.15s;
    line-height: 1;
}

.lionate-modal-close:hover {
    opacity: 1;
}

.lionate-modal-close svg {
    width: 24px;
    height: 24px;
}

/* Modal Body */
.lionate-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.lionate-modal-description {
    margin: 0 0 1.5rem;
    opacity: 0.9;
    font-size: var(--lionate-font-size);
}

/* Cookie Categories */
.lionate-cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lionate-cookie-category {
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: calc(var(--lionate-border-radius) * 0.75);
}

.lionate-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.lionate-category-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.lionate-always-active {
    display: inline-block;
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 500;
    margin-left: 0.5rem;
}

.lionate-category-description {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.8;
    line-height: 1.5;
}

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

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

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

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

.lionate-toggle input:checked + .lionate-toggle-slider {
    background-color: var(--lionate-primary-btn-bg);
}

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

.lionate-toggle input:focus + .lionate-toggle-slider {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.lionate-toggle-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lionate-toggle-disabled .lionate-toggle-slider {
    cursor: not-allowed;
    background-color: var(--lionate-primary-btn-bg) !important;
}

/* Modal Footer */
.lionate-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lionate-modal-footer .lionate-btn {
    flex: 1;
}

/* Animations */
.lionate-cookie-banner {
    animation: lionate-slideIn 0.3s ease;
}

.lionate-banner-bottom {
    animation-name: lionate-slideUp;
}

.lionate-banner-top {
    animation-name: lionate-slideDown;
}

.lionate-banner-bottom-left,
.lionate-banner-bottom-right {
    animation-name: lionate-fadeIn;
}

.lionate-banner-center {
    animation-name: lionate-scaleIn;
}

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

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

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

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

.lionate-cookie-modal {
    animation: lionate-modalFadeIn 0.2s ease;
}

@keyframes lionate-modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .lionate-banner-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1rem;
    }

    .lionate-banner-text {
        min-width: auto;
    }

    .lionate-banner-actions {
        width: 100%;
        flex-direction: column;
    }

    .lionate-banner-bottom-left,
    .lionate-banner-bottom-right {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .lionate-modal-content {
        max-height: calc(100vh - 20px);
    }

    .lionate-modal-body {
        padding: 1rem;
    }

    .lionate-modal-footer {
        flex-direction: column;
        padding: 1rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .lionate-banner-content,
    .lionate-modal-content {
        border: 2px solid currentColor;
    }

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lionate-cookie-banner,
    .lionate-cookie-modal,
    .lionate-toggle-slider,
    .lionate-toggle-slider::before,
    .lionate-btn {
        animation: none;
        transition: none;
    }
}
