/**
 * Cookie Consent CSS
 * GDPR/AVG-compliant cookie consent styling
 * 
 * Following AllCarsCuraçao enterprise standards with Tailwind CSS compatibility
 */

/* Cookie Consent Banner */
#cookie-consent-banner {
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Animation for banner slide up */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Cookie Customization Modal */
#cookie-customization-modal {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Modal animation */
#cookie-customization-modal:not(.hidden) .bg-white {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Toggle Switch Enhancements */
.cookie-category-toggle:checked + div {
    background-color: #0ea5e9; /* sky-500 */
}

.cookie-category-toggle:focus + div {
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

/* Button hover effects */
#cookie-accept-all-btn:hover {
    background-color: #0369a1; /* sky-700 */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#cookie-reject-all-btn:hover,
#cookie-customize-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.cookie-btn-loading {
    position: relative;
    color: transparent !important;
}

.cookie-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Message notifications */
#cookie-message {
    animation: slideInRight 0.3s ease-out;
}

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

/* Responsive adjustments */
@media (max-width: 640px) {
    #cookie-consent-banner .flex-col {
        gap: 1rem;
    }
    
    #cookie-consent-banner .sm\:flex-row {
        flex-direction: column;
    }
    
    #cookie-customization-modal .max-w-2xl {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
    }
}

/* Accessibility improvements */
.cookie-category-toggle:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #cookie-consent-banner {
        border-top: 2px solid #000;
    }
    
    .cookie-category-toggle:checked + div {
        background-color: #000;
    }
    
    button {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate-slide-up,
    #cookie-customization-modal:not(.hidden) .bg-white,
    #cookie-message {
        animation: none;
    }
    
    #cookie-accept-all-btn:hover,
    #cookie-reject-all-btn:hover,
    #cookie-customize-btn:hover {
        transform: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    #cookie-consent-banner {
        background-color: #1f2937; /* gray-800 */
        border-top-color: #374151; /* gray-700 */
        color: #f9fafb; /* gray-50 */
    }
    
    #cookie-customization-modal .bg-white {
        background-color: #1f2937; /* gray-800 */
        color: #f9fafb; /* gray-50 */
    }
    
    #cookie-customization-modal .border-gray-200 {
        border-color: #374151; /* gray-700 */
    }
    
    #cookie-customization-modal .bg-gray-50 {
        background-color: #111827; /* gray-900 */
    }
}

/* Print styles */
@media print {
    #cookie-consent-banner,
    #cookie-customization-modal,
    #cookie-message {
        display: none !important;
    }
}

/* Cookie settings link in footer */
.cookie-settings-link {
    color: #0ea5e9; /* sky-500 */
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cookie-settings-link:hover {
    color: #0369a1; /* sky-700 */
}

/* Category cards styling */
.cookie-category-card {
    transition: all 0.2s ease;
}

.cookie-category-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Toggle switch custom styling */
.cookie-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

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

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

input:checked + .cookie-toggle-slider {
    background-color: #0ea5e9;
}

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

/* Focus states for better accessibility */
.cookie-toggle-switch input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3);
}

/* Banner positioning adjustments */
#cookie-consent-banner.banner-top {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Compact banner variant */
#cookie-consent-banner.banner-compact {
    padding: 0.75rem 0;
}

#cookie-consent-banner.banner-compact .text-lg {
    font-size: 1rem;
}

#cookie-consent-banner.banner-compact .text-sm {
    font-size: 0.875rem;
}

/* Cookie icon animation */
.cookie-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
