/* Professional GDPR Cookie Banner Styles */

.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(50px) scale(0.95);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: inherit;
    pointer-events: none;
    width: 90%;
    max-width: 1150px;
}

.cookie-banner.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

/* Backdrop removed completely */

.cookie-content {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(10px);
}

/* Main Banner Layout */
.cookie-main-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    width: 100%;
}

.cookie-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.cookie-text {
    flex: 1;
    min-width: 0;
}

.cookie-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color, #333333);
}

.cookie-text p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-color-secondary, #666666);
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Button Styles */
.cookie-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cookie-button.primary {
    background: var(--brand-color-3, #0ea5e9);
    color: white;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

.cookie-button.primary:hover {
    background: var(--brand-color-2, #0284c7);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

.cookie-button.secondary {
    background: transparent;
    color: var(--text-color, #333333);
    border: 2px solid var(--border-color, #e0e0e0);
}

.cookie-button.secondary:hover {
    background: var(--background-color-secondary, #f8f9fa);
    border-color: var(--border-color-hover, #c0c0c0);
}

.cookie-button.tertiary {
    background: transparent;
    color: var(--brand-color-3, #0ea5e9);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-button.tertiary:hover {
    color: var(--brand-color-2, #0284c7);
    background: rgba(14, 165, 233, 0.05);
}

/* Preferences Panel */
.cookie-preferences-panel {
    display: none;
    padding: 2rem 1.5rem;
    background: transparent;
    width: 100%;
}

.cookie-banner.show-preferences .cookie-main-banner {
    display: none;
}

.cookie-banner.show-preferences .cookie-preferences-panel {
    display: block;
}

.cookie-preferences-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.cookie-preferences-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color, #333333);
}

.cookie-back-btn {
    background: none;
    border: 2px solid var(--border-color, #e0e0e0);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color, #333333);
    transition: all 0.2s ease;
}

.cookie-back-btn:hover {
    background: var(--background-color-secondary, #f8f9fa);
    border-color: var(--border-color-hover, #c0c0c0);
}

/* Cookie Categories */
.cookie-categories {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cookie-category {
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem;
    gap: 1rem;
}

.cookie-category-info {
    flex: 1;
    min-width: 0;
}

.cookie-category-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color, #333333);
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color-secondary, #666666);
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.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: #ccc;
    transition: 0.3s;
    border-radius: 14px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--brand-color-3, #0ea5e9);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: var(--brand-color-3, #0ea5e9);
    opacity: 0.6;
    cursor: not-allowed;
}

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

/* Category Details */
.cookie-category-details {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid rgba(240, 240, 240, 0.5);
    background: rgba(248, 249, 250, 0.6);
}

.cookie-purpose {
    margin: 1rem 0 0.75rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-color-secondary, #666666);
    font-style: italic;
}

.cookie-list {
    font-size: 0.8rem;
    color: var(--text-color-tertiary, #888888);
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

/* Preferences Footer */
.cookie-preferences-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

.cookie-legal-info {
    flex: 1;
}

.cookie-legal-info p {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    color: var(--text-color-tertiary, #888888);
}

.cookie-preferences-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.cookie-policy-link {
    font-size: 0.85rem;
    color: var(--brand-color-3, #0ea5e9);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.cookie-policy-link:hover {
    border-bottom-color: var(--brand-color-3, #0ea5e9);
}

/* Withdrawal Option */
.cookie-withdrawal {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.cookie-withdraw-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.5);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-color, #333333);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.cookie-withdraw-btn:hover {
    background: rgba(248, 249, 250, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner {
        bottom: 1rem;
        width: calc(100% - 2rem);
        max-width: none;
    }
    
    .cookie-main-banner {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .cookie-icon {
        align-self: center;
        font-size: 1.25rem;
    }
    
    .cookie-text {
        text-align: center;
    }
    
    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-button {
        flex: 1;
        min-width: 0;
        padding: 0.625rem 0.75rem;
    }
    
    .cookie-preferences-panel {
        padding: 1.25rem;
    }
    
    .cookie-preferences-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .cookie-category-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .cookie-toggle {
        align-self: flex-end;
    }
    
    .cookie-preferences-footer {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    
    .cookie-preferences-actions {
        align-items: stretch;
    }
    
    .cookie-withdrawal {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .cookie-withdraw-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-button {
        width: 100%;
    }
    
    .cookie-content {
        max-height: 90vh;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .cookie-content {
        background: rgba(26, 26, 26, 0.9);
        border: 1px solid rgba(51, 51, 51, 0.5);
    }
    
    .cookie-category {
        background: rgba(42, 42, 42, 0.7);
        border: 1px solid rgba(51, 51, 51, 0.5);
    }
    
    .cookie-category-details {
        background: rgba(42, 42, 42, 0.6);
        border-top: 1px solid rgba(42, 42, 42, 0.5);
    }
    
    .cookie-list {
        background: rgba(26, 26, 26, 0.8);
        border: 1px solid rgba(51, 51, 51, 0.5);
    }
    
    .cookie-withdraw-btn {
        background: rgba(26, 26, 26, 0.9);
        border: 1px solid rgba(51, 51, 51, 0.5);
    }
    
    .cookie-withdraw-btn:hover {
        background: rgba(42, 42, 42, 0.9);
    }
    
    .cookie-banner {
        --text-color: #ffffff;
        --text-color-secondary: #cccccc;
        --text-color-tertiary: #999999;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cookie-banner {
        --border-color: #000000;
        --border-color-hover: #000000;
    }
    
    .cookie-button.secondary {
        border-width: 3px;
    }
    
    .cookie-category {
        border-width: 2px;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-button,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none;
    }
}

/* Focus Styles for Accessibility */
.cookie-button:focus-visible,
.cookie-toggle:focus-within,
.cookie-back-btn:focus-visible,
.cookie-withdraw-btn:focus-visible,
.cookie-policy-link:focus-visible {
    outline: 2px solid var(--brand-color-3, #0ea5e9);
    outline-offset: 2px;
}

/* Screen Reader Only Content */
.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;
}