/* Cookie Consent Styles */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #2d3748;
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

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

.cookie-content p {
    margin: 0;
    flex: 1;
    min-width: 300px;
    line-height: 1.5;
    color: #fff;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-buttons .btn {
    padding: 10px 20px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.cookie-buttons .btn-primary {
    background-color: #3182ce;
    color: white;
    border: none;
}

.cookie-buttons .btn-primary:hover {
    background-color: #2c5aa0;
}

.cookie-buttons .btn-secondary {
    background-color: #4a5568;
    color: white;
    border: none;
}

.cookie-buttons .btn-secondary:hover {
    background-color: #2d3748;
}

.cookie-buttons .btn-outline {
    background-color: transparent;
    color: white;
    border: 2px solid #a0aec0;
}

.cookie-buttons .btn-outline:hover {
    background-color: #a0aec0;
    color: #2d3748;
}

/* Cookie Settings Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.cookie-modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal.show .cookie-modal-content {
    transform: scale(1);
}

.cookie-modal-content h3 {
    color: #2d3748;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.cookie-category {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #3182ce;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cookie-category-header h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.125rem;
}

.cookie-category-header input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #3182ce;
}

.cookie-category p {
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

.cookie-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cookie-modal-buttons .btn {
    padding: 12px 24px;
}

/* Cookie Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    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: #cbd5e0;
    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%;
}

input:checked + .cookie-slider {
    background-color: #3182ce;
}

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

input:disabled + .cookie-slider {
    background-color: #e2e8f0;
    cursor: not-allowed;
}

input:disabled + .cookie-slider:before {
    background-color: #a0aec0;
}

/* Cookie Banner Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

.cookie-consent.animate-in {
    animation: slideUp 0.3s ease forwards;
}

.cookie-consent.animate-out {
    animation: slideDown 0.3s ease forwards;
}

/* Cookie Status Indicator */
.cookie-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3182ce;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.cookie-status.success {
    background-color: #38a169;
}

.cookie-status.warning {
    background-color: #d69e2e;
}

.cookie-status.error {
    background-color: #e53e3e;
}

/* Cookie Preferences Link */
.cookie-preferences-link {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: #4a5568;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-decoration: none;
    z-index: 9998;
    transition: all 0.3s ease;
}

.cookie-preferences-link:hover {
    background-color: #2d3748;
    color: white;
    transform: translateY(-2px);
}

/* Responsive Cookie Consent */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .cookie-content p {
        min-width: auto;
        text-align: center;
    }
    
    .cookie-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-buttons .btn {
        text-align: center;
    }
    
    .cookie-modal-content {
        padding: 2rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .cookie-modal-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cookie-status {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .cookie-preferences-link {
        bottom: 60px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cookie-consent {
        padding: 1rem;
    }
    
    .cookie-modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .cookie-category {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .cookie-buttons .btn {
        padding: 12px 16px;
        font-size: 0.875rem;
    }
}

/* Cookie consent overlay for better UX */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Cookie categories styling */
.cookie-category.essential {
    border-left-color: #38a169;
}

.cookie-category.analytics {
    border-left-color: #3182ce;
}

.cookie-category.marketing {
    border-left-color: #d69e2e;
}

.cookie-category.preferences {
    border-left-color: #805ad5;
}

/* Cookie description text */
.cookie-description {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Cookie vendor info */
.cookie-vendor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.cookie-vendor-name {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.875rem;
}

.cookie-vendor-link {
    color: #3182ce;
    font-size: 0.75rem;
    text-decoration: none;
}

.cookie-vendor-link:hover {
    text-decoration: underline;
}

/* Cookie expiry info */
.cookie-expiry {
    display: inline-block;
    background-color: #e2e8f0;
    color: #4a5568;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Loading state for cookie actions */
.cookie-loading {
    pointer-events: none;
    opacity: 0.7;
}

.cookie-loading .btn {
    position: relative;
}

.cookie-loading .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Cookie consent for print */
@media print {
    .cookie-consent,
    .cookie-modal,
    .cookie-status,
    .cookie-preferences-link,
    .cookie-overlay {
        display: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .cookie-consent {
        border-top: 3px solid white;
    }
    
    .cookie-modal-content {
        border: 2px solid #2d3748;
    }
    
    .cookie-category {
        border: 1px solid #2d3748;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent,
    .cookie-modal,
    .cookie-modal-content,
    .cookie-slider,
    .cookie-slider:before,
    .cookie-status,
    .cookie-preferences-link {
        transition: none !important;
        animation: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .cookie-modal-content {
        background-color: #2d3748;
        color: white;
    }
    
    .cookie-modal-content h3 {
        color: white;
    }
    
    .cookie-category {
        background-color: #4a5568;
    }
    
    .cookie-category-header h4 {
        color: white;
    }
    
    .cookie-category p {
        color: #a0aec0;
    }
    
    .cookie-vendor-name {
        color: white;
    }
}
