/* Cookie Consent Banner - Base Styles */
.cookie-consent-banner {
    z-index: 999999;
}

/* Design 1: Modal Popup */
.cookie-banner-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Design 2 & 3: Bottom Banners */
.cookie-banner-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
    border-top: 1px solid #e5e7eb;
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-banner-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

.cookie-banner-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.cookie-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-banner-text h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.cookie-banner-text p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.cookie-policy-link-inline {
    color: var(--cookie-primary-color, #2563eb);
    text-decoration: none;
}

.cookie-policy-link-inline:hover {
    text-decoration: underline;
}

.cookie-banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-btn-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 10px 16px;
}

.cookie-btn-icon:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cookie-btn-icon svg {
    width: 16px;
    height: 16px;
}


.cookie-consent-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.cookie-consent-content h3 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.cookie-consent-content p {
    margin: 0 0 24px 0;
    color: #6b7280;
    line-height: 1.6;
    font-size: 16px;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.cookie-btn-primary {
    background: var(--cookie-primary-color, #2563eb);
    color: var(--cookie-text-color, #ffffff);
}

.cookie-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cookie-btn-primary:active {
    transform: translateY(0);
}

.cookie-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.cookie-btn-secondary:hover {
    background: #d1d5db;
}

.cookie-btn-link {
    background: transparent;
    color: var(--cookie-primary-color, #2563eb);
    text-decoration: underline;
    padding: 12px 16px;
}

.cookie-btn-link:hover {
    opacity: 0.8;
}

/* Settings button in modal */
.cookie-consent-content .cookie-btn-icon {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.cookie-consent-content .cookie-btn-icon:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cookie-policy-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--cookie-primary-color, #2563eb);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s;
}

.cookie-policy-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Cookie Consent Modal */
.cookie-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.cookie-consent-modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cookie-consent-modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
}

.cookie-categories {
    margin-bottom: 24px;
}

.cookie-category {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #f9fafb;
    transition: border-color 0.2s;
}

.cookie-category:hover {
    border-color: var(--cookie-primary-color, #2563eb);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-category-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.cookie-badge {
    background: #10b981;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.cookie-category p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.cookie-toggle 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: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    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-slider {
    background-color: var(--cookie-primary-color, #2563eb);
}

.cookie-toggle input:checked + .cookie-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-consent-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Settings Icon */
.cookie-settings-icon {
    position: fixed;
    width: 56px;
    height: 56px;
    background: var(--cookie-primary-color, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    z-index: 999998;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    user-select: none;
}

.cookie-settings-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.cookie-settings-icon:active {
    transform: scale(1.05);
}

.cookie-settings-icon.bottom-right {
    bottom: 20px;
    right: 20px;
}

.cookie-settings-icon.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Adjust icon position when bottom banner is visible */
.cookie-settings-icon.banner-visible.bottom-right {
    bottom: 100px;
}

.cookie-settings-icon.banner-visible.bottom-left {
    bottom: 100px;
}

.cookie-settings-link {
    color: var(--cookie-primary-color, #2563eb);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 14px;
}

.cookie-settings-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Footer Link Styling */
#cookie-consent-footer-link {
    text-align: center;
    padding: 16px;
    font-size: 14px;
    margin-top: 20px;
}

#cookie-consent-footer-link .cookie-settings-link {
    color: var(--cookie-primary-color, #2563eb);
    text-decoration: none;
    transition: opacity 0.2s;
}

#cookie-consent-footer-link .cookie-settings-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Optional: If injected into existing footer */
footer #cookie-consent-footer-link,
.site-footer #cookie-consent-footer-link,
#footer #cookie-consent-footer-link {
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-bottom-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .cookie-banner-left {
        flex-direction: column;
        gap: 12px;
    }
    
    .cookie-banner-right {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .cookie-banner-right .cookie-btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 640px) {
    .cookie-consent-content,
    .cookie-consent-modal-content {
        padding: 24px;
    }
    
    .cookie-consent-content h3 {
        font-size: 20px;
    }
    
    .cookie-consent-modal-content h2 {
        font-size: 24px;
    }
    
    .cookie-consent-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
    
    .cookie-banner-bottom {
        padding: 16px;
    }
    
    .cookie-banner-text h4 {
        font-size: 16px;
    }
    
    .cookie-banner-text p {
        font-size: 13px;
    }
    
    .cookie-banner-right {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-banner-right .cookie-btn {
        width: 100%;
    }
    
    .cookie-settings-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        bottom: 16px;
        right: 16px;
    }
    
    .cookie-settings-icon.bottom-left {
        bottom: 16px;
        left: 16px;
    }
    
    .cookie-consent-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-consent-modal-actions .cookie-btn {
        width: 100%;
    }
}

/* Accessibility */
.cookie-settings-icon:focus,
.cookie-btn:focus {
    outline: 2px solid var(--cookie-primary-color, #2563eb);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .cookie-consent-banner,
    .cookie-consent-modal,
    .cookie-settings-icon,
    #cookie-consent-footer-link {
        display: none !important;
    }
}
