/**
 * Cookie Consent Banner Styles
 * GDPR-compliant cookie consent UI
 */

/* Banner */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
}

.cookie-banner-text p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons */
.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cookie-btn-necessary {
    background: #6c757d;
    color: white;
}

.cookie-btn-necessary:hover {
    background: #5a6268;
}

.cookie-btn-settings {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.cookie-btn-settings:hover {
    background: #f8f9fa;
}

.cookie-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.cookie-btn-secondary:hover {
    background: #e9ecef;
}

/* Button Active States (for touch feedback on mobile/iPad) */
.cookie-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.cookie-btn-accept:active {
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Button Disabled States */
.cookie-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none;
}

.cookie-btn:disabled:hover {
    transform: none;
}

/* Loading Spinner */
.cookie-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* Error Message */
.cookie-error-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

.cookie-error-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-error-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cookie-error-text {
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Modal Error Message */
.cookie-modal-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    animation: slideIn 0.3s ease-out;
}

/* Preferences Modal */
#cookie-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.cookie-modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

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

.cookie-category-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.cookie-category h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    color: #333;
}

.cookie-category-desc {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

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

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

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

.cookie-switch input:checked + .cookie-slider {
    background-color: #667eea;
}

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

.cookie-switch input:disabled + .cookie-slider {
    background-color: #667eea;
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    .cookie-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem 1.5rem;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
}

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