/**
 * 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 {
    background: #ffffff;
    border: 1px solid #e9ecef;
    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: all 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.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;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

/* Content Layout */
.cookie-content {
    margin-bottom: 20px;
}

.cookie-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    line-height: 1.3;
}

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

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

.privacy-link:hover {
    color: #005a87;
}

/* Cookie Categories */
.cookie-categories {
    display: none;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

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

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

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

.cookie-category input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
}

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

.cookie-category p {
    margin: 5px 0 0 24px;
    font-size: 13px;
    color: #666666;
    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;
}

.cookie-buttons button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Accept Button */
.cookie-accept {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    border-color: #28a745;
}

.cookie-accept:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Reject Button */
.cookie-reject {
    background: transparent;
    color: #6c757d;
    border-color: #dee2e6;
}

.cookie-reject:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
}

/* Preferences Button */
.cookie-preferences {
    background: transparent;
    color: #007cba;
    border-color: #007cba;
}

.cookie-preferences:hover {
    background: #007cba;
    color: #ffffff;
}

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

.cookie-close:hover {
    color: #495057;
}

.cookie-close:focus {
    outline: 2px solid #007cba;
    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 */
@media (prefers-color-scheme: dark) {
    .cookie-consent-banner {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .cookie-title {
        color: #f7fafc;
    }
    
    .cookie-message {
        color: #cbd5e0;
    }
    
    .cookie-categories {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .cookie-category label {
        color: #e2e8f0;
    }
    
    .cookie-category p {
        color: #a0aec0;
    }
    
    .cookie-reject {
        color: #a0aec0;
        border-color: #4a5568;
    }
    
    .cookie-reject:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .cookie-close {
        color: #a0aec0;
    }
    
    .cookie-close:hover {
        color: #e2e8f0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-width: 2px;
        border-color: #000000;
    }
    
    .cookie-buttons button {
        border-width: 2px;
    }
    
    .cookie-accept {
        background: #000000;
        border-color: #000000;
    }
    
    .cookie-reject,
    .cookie-preferences {
        border-color: #000000;
        color: #000000;
    }
}

/* 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: #007cba;
}

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

.cookie-category input[type="checkbox"]:focus-visible {
    outline: 2px solid #007cba;
    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;
}
