/**
 * Cookie Consent Banner Widget Styles
 * Modern, GDPR-compliant design with multiple layout options
 */

.cookie-consent-widget {
    position: relative;
    font-family: inherit;
}

/* Banner Base Styles */
.cookie-consent-banner {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
    will-change: opacity, transform;
}

/* Fallback for browsers without transform support */
@supports not (transform: translateY(20px)) {
    .cookie-consent-banner {
        transform: none;
        transition: opacity 0.3s ease;
    }
}

.cookie-consent-banner.show {
    opacity: 1;
    transform: translateY(0);
}

/* Layout Types */
.cookie-consent-widget.layout-bar .cookie-consent-banner {
    border-radius: 0;
    border-left: none;
    border-right: none;
    width: 100%;
    max-width: none;
}

.cookie-consent-widget.layout-bar.position-top .cookie-consent-banner {
    border-top: none;
    border-radius: 0 0 8px 8px;
    transform: translateY(-20px);
}

.cookie-consent-widget.layout-bar.position-bottom .cookie-consent-banner {
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transform: translateY(20px);
}

.cookie-consent-widget.layout-modal .cookie-consent-banner {
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
}

.cookie-consent-widget.layout-modal .cookie-consent-banner.show {
    transform: scale(1);
}

.cookie-consent-widget.layout-floating .cookie-consent-banner {
    max-width: 400px;
    width: auto;
    min-width: 300px;
}

/* Overlay for Modal */
.cookie-overlay {
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    backdrop-filter: blur(2px);
}

/* Content Styles */
.cookie-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.cookie-message {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.privacy-link {
    text-decoration: underline;
    transition: color 0.3s ease;
}

/* Cookie Categories */
.cookie-categories {
    display: none;
    margin: 15px 0;
    padding: 15px;
    border-radius: 6px;
}

.cookie-category {
    margin-bottom: 12px;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.cookie-category input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.cookie-category input[type="checkbox"]:checked {
    background-color: #007cba;
    border-color: #007cba;
}

.cookie-category input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    line-height: 1;
}

.cookie-category input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-category p {
    margin: 5px 0 0 24px;
    font-size: 13px;
    line-height: 1.4;
}

/* Button Container */
.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Button Base Styles */
.cookie-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 40px;
    box-sizing: border-box;
    background: transparent; /* Reset browser defaults */
}

.cookie-buttons button:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Accept Button - Reset for Elementor background control */
.cookie-consent-widget .cookie-buttons .cookie-accept {
    background: none; /* Reset browser button defaults */
    background-color: transparent; /* Clean slate for Elementor */
    background-image: none; /* Remove browser gradients */
}

/* Button hover effects */
.cookie-accept:hover {
    transform: translateY(-1px);
}

.cookie-reject:hover {
    transform: translateY(-1px);
}

.cookie-preferences:hover {
    transform: translateY(-1px);
}

/* Close Button */
.cookie-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 1;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 16px;
        font-size: 13px;
    }
    
    .cookie-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .cookie-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-buttons button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .cookie-buttons button:last-child {
        margin-bottom: 0;
    }
    
    .cookie-consent-widget.layout-floating .cookie-consent-banner {
        min-width: 280px;
        max-width: calc(100vw - 40px);
    }
    
    .cookie-consent-widget.layout-modal .cookie-consent-banner {
        width: 95%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: 12px;
        font-size: 12px;
    }
    
    .cookie-title {
        font-size: 14px;
    }
    
    .cookie-buttons button {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 36px;
    }
    
    .cookie-close {
        top: 8px;
        right: 8px;
        font-size: 20px;
        width: 26px;
        height: 26px;
    }
}

/* Dark Mode Support - Only structural changes, colors handled by Elementor */
@media (prefers-color-scheme: dark) {
    /* Structural styles only - colors are controlled by Elementor */
}

/* High Contrast Mode - Only structural changes */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-width: 2px;
    }
    
    .cookie-buttons button {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-overlay,
    .cookie-buttons button,
    .privacy-link {
        transition: none;
    }
    
    .cookie-consent-banner.show {
        transform: none;
    }
    
    .cookie-accept:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .cookie-consent-banner,
    .cookie-overlay {
        display: none !important;
    }
}

/* Animation Keyframes */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Layout-specific animations */
.cookie-consent-widget.layout-bar.position-bottom .cookie-consent-banner.show {
    animation: slideInFromBottom 0.3s ease;
}

.cookie-consent-widget.layout-bar.position-top .cookie-consent-banner.show {
    animation: slideInFromTop 0.3s ease;
}

.cookie-consent-widget.layout-modal .cookie-consent-banner.show {
    animation: fadeInScale 0.3s ease;
}

.cookie-consent-widget.layout-floating .cookie-consent-banner.show {
    animation: fadeInScale 0.3s ease;
}

/* Body adjustments when banner is visible */
body.cookie-consent-visible.layout-bar.position-top {
    padding-top: 80px;
}

body.cookie-consent-visible.layout-bar.position-bottom {
    padding-bottom: 80px;
}

/* Focus trap for modal */
.cookie-consent-widget.layout-modal .cookie-consent-banner {
    position: relative;
}

.cookie-consent-widget.layout-modal .cookie-consent-banner::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid transparent;
    border-radius: 10px;
    pointer-events: none;
}

.cookie-consent-widget.layout-modal .cookie-consent-banner:focus-within::before {
    border-color: currentColor;
}

/* Accessibility improvements */
.cookie-buttons button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.cookie-category input[type="checkbox"]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Loading state */
.cookie-consent-banner.loading {
    pointer-events: none;
    opacity: 0.7;
}

.cookie-consent-banner.loading .cookie-buttons button {
    cursor: not-allowed;
}

/* Additional responsive improvements */
@media (max-width: 768px) {
    .cookie-consent-widget.layout-floating .cookie-consent-banner {
        max-width: calc(100vw - 40px);
        left: 20px !important;
        right: 20px !important;
        bottom: 20px !important;
        top: auto !important;
    }
    
    .cookie-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .cookie-buttons button {
        width: 100%;
        justify-content: center;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border: 2px solid;
    }
    
    .cookie-buttons button {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner {
        transition: none;
        transform: none;
    }
    
    .cookie-consent-banner.show {
        transform: none;
    }
}
