/**
 * Cookie Consent Banner & Modal Styles
 * GDPR/CCPA compliant cookie consent interface
 */

/* Cookie Banner (Bottom notification) */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

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

.cookie-banner-text a {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-weight: 500;
}

.cookie-banner-text a:hover {
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-banner-actions .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.btn-accept-all {
    background: var(--primary-color, #3b82f6);
    color: white;
}

.btn-accept-all:hover {
    background: var(--primary-dark, #2563eb);
    transform: translateY(-1px);
}

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

.btn-essential-only:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-customize {
    background: transparent;
    color: var(--primary-color, #3b82f6);
    border: 1px solid var(--primary-color, #3b82f6);
}

.btn-customize:hover {
    background: var(--primary-color, #3b82f6);
    color: white;
}

/* Cookie Preferences Modal */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.cookie-modal-overlay.show .cookie-modal {
    transform: scale(1) translateY(0);
}

.cookie-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e5e5;
    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: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.cookie-modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

.cookie-modal-body {
    padding: 24px;
}

.cookie-modal-intro {
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
}

/* Cookie Categories */
.cookie-category {
    margin-bottom: 24px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.cookie-category-header {
    padding: 16px 20px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cookie-category-header:hover {
    background: #e9ecef;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
}

.cookie-category-icon {
    font-size: 1.1rem;
    color: var(--primary-color, #3b82f6);
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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: 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%;
}

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

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-category-content {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e5e5;
    display: none;
}

.cookie-category.expanded .cookie-category-content {
    display: block;
}

.cookie-category-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 16px;
}

.cookie-category-examples {
    font-size: 0.85rem;
    color: #888;
    margin-top: 12px;
}

.cookie-category-examples strong {
    color: #666;
}

.cookie-category.essential .cookie-toggle {
    pointer-events: none;
}

.cookie-category.essential .cookie-category-title::after {
    content: "(Required)";
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
    margin-left: 8px;
}

/* Modal Footer */
.cookie-modal-footer {
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cookie-modal-footer .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.btn-save-preferences {
    background: var(--primary-color, #3b82f6);
    color: white;
}

.btn-save-preferences:hover {
    background: var(--primary-dark, #2563eb);
}

.btn-accept-all-modal {
    background: #28a745;
    color: white;
}

.btn-accept-all-modal:hover {
    background: #218838;
}

/* Cookie Preferences Link */
.cookie-preferences-link {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--primary-color, #3b82f6);
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.cookie-preferences-link:hover {
    background: var(--primary-dark, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.cookie-preferences-link.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 16px;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .cookie-banner-actions {
        justify-content: center;
        gap: 8px;
    }
    
    .cookie-banner-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .cookie-modal {
        width: 95%;
        margin: 20px;
        max-height: 90vh;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 16px;
    }
    
    .cookie-category-header {
        padding: 12px 16px;
    }
    
    .cookie-category-content {
        padding: 16px;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer .btn {
        width: 100%;
    }
    
    .cookie-preferences-link {
        bottom: 10px;
        left: 10px;
        right: 10px;
        text-align: center;
        border-radius: 12px;
    }
}

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

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

.cookie-banner.animate-in {
    animation: slideUp 0.5s ease-out;
}

.cookie-modal-overlay.animate-in {
    animation: fadeIn 0.3s ease-out;
}