/**
 * ZaynScope DSGVO Consent Styles
 * CSS-Variablen für automatisches Theme-Matching
 */

:root {
    /* ZaynScope Theme Colors - Fallbacks für CSS-Variablen */
    --zs-black: #000000;
    --zs-white: #ffffff;
    --zs-yellow: #fbbf24;
    --zs-gray: #374151;
    --zs-gray-light: #4b5563;
    --zs-gray-dark: #1f2937;
    
    /* Consent-spezifische Variablen */
    --zs-consent-backdrop: rgba(0, 0, 0, 0.7);
    --zs-consent-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --zs-consent-border: rgba(251, 191, 36, 0.2);
    --zs-consent-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Banner Styles */
#zs-consent-banner {
    transform: translateY(100%);
    animation: slideInUp 0.3s ease-out forwards;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes slideInUp {
    to {
        transform: translateY(0);
    }
}

/* Modal Styles */
#zs-consent-modal {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#zs-consent-modal .bg-zayn-black {
    background-color: var(--zs-black, #000000);
}

#zs-consent-modal .text-zayn-white {
    color: var(--zs-white, #ffffff);
}

#zs-consent-modal .text-zayn-yellow {
    color: var(--zs-yellow, #fbbf24);
}

#zs-consent-modal .bg-zayn-yellow {
    background-color: var(--zs-yellow, #fbbf24);
}

#zs-consent-modal .text-zayn-black {
    color: var(--zs-black, #000000);
}

#zs-consent-modal .border-zayn-yellow {
    border-color: var(--zs-yellow, #fbbf24);
}

#zs-consent-modal .bg-zayn-gray {
    background-color: var(--zs-gray, #374151);
}

/* Enhanced Focus Styles */
.zs-consent-focus:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--zs-yellow, #fbbf24);
    border-radius: 0.5rem;
}

/* Button States */
.zs-consent-btn {
    position: relative;
    overflow: hidden;
    transition: var(--zs-consent-transition);
}

.zs-consent-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.zs-consent-btn:hover:before {
    left: 100%;
}

/* Toggle Switch Styles */
.zs-consent-toggle {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background-color: var(--zs-gray-light, #4b5563);
    border-radius: 9999px;
    transition: var(--zs-consent-transition);
    cursor: pointer;
}

.zs-consent-toggle:checked {
    background-color: var(--zs-yellow, #fbbf24);
}

.zs-consent-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zs-consent-toggle:before {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: white;
    border-radius: 50%;
    transition: var(--zs-consent-transition);
}

.zs-consent-toggle:checked:before {
    transform: translateX(1.25rem);
}

.zs-consent-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--zs-yellow, #fbbf24);
}

/* Placeholder Styles */
.consent-placeholder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    text-align: center;
    transition: var(--zs-consent-transition);
}

.consent-placeholder:hover {
    border-color: var(--zs-yellow, #fbbf24);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.consent-placeholder button {
    background-color: var(--zs-yellow, #fbbf24);
    color: var(--zs-black, #000000);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--zs-consent-transition);
}

.consent-placeholder button:hover {
    background-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Loading States */
.zs-consent-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.zs-consent-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 640px) {
    #zs-consent-banner {
        padding: 1rem;
    }
    
    #zs-consent-banner .flex-col {
        gap: 1rem;
    }
    
    #zs-consent-modal .max-w-2xl {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --zs-consent-border: rgba(251, 191, 36, 0.6);
    }
    
    .zs-consent-btn {
        border-width: 2px;
        border-style: solid;
    }
}

/* Dark Mode Support (falls Theme unterstützt) */
@media (prefers-color-scheme: dark) {
    :root {
        --zs-black: #000000;
        --zs-white: #ffffff;
        --zs-gray: #374151;
        --zs-gray-light: #4b5563;
    }
}

/* Print Styles */
@media print {
    #zs-consent-banner,
    #zs-consent-modal {
        display: none !important;
    }
}

/* Screen Reader Specific */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Visible Polyfill */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

/* Custom Scrollbar für Modal */
#zs-consent-modal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#zs-consent-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: var(--zs-gray-dark, #1f2937);
    border-radius: 3px;
}

#zs-consent-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: var(--zs-yellow, #fbbf24);
    border-radius: 3px;
}

#zs-consent-modal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* Animation für Consent Changes */
.consent-category-changed {
    animation: highlightChange 0.5s ease-in-out;
}

@keyframes highlightChange {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(251, 191, 36, 0.1); }
}

/* Tooltip für Disabled Elements */
.zs-consent-tooltip {
    position: relative;
}

.zs-consent-tooltip[data-tooltip]:hover:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--zs-black, #000000);
    color: var(--zs-white, #ffffff);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 60;
    margin-bottom: 0.25rem;
}

.zs-consent-tooltip[data-tooltip]:hover:after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--zs-black, #000000);
    z-index: 60;
}