/**
 * Cookie Consent Styles
 * Modern UX with emphasis on acceptance
 */

/* Backdrop - subtle dark overlay */
.cookie-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cookie-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.cookie-backdrop.transparent {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

/* Main Banner - bottom positioned for less intrusion */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(22, 23, 22, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 
        0 -10px 40px rgba(0, 0, 0, 0.3),
        0 -2px 20px rgba(245, 158, 11, 0.1);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Content Container */
.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
}

/* Text Section */
.cookie-text {
    color: var(--text-secondary, #ffffff);
}

.cookie-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.5rem 0;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.cookie-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 0.75rem 0;
}

/* Responsive text visibility */
.cookie-desc-mobile {
    display: none;
}

@media (max-width: 768px) {
    .cookie-desc-desktop {
        display: none;
    }
    .cookie-desc-mobile {
        display: inline;
    }
}

.cookie-policy-link {
    font-size: 0.875rem;
    color: var(--aerraflow-primary, #f59e0b);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.cookie-policy-link:hover {
    border-bottom-color: var(--aerraflow-primary, #f59e0b);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Action Buttons - Strategic sizing and coloring */
.cookie-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cookie-btn {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: lowercase;
    white-space: nowrap;
}

/* Accept All - Primary CTA with emphasis */
.cookie-accept-all {
    background: var(--aerraflow-primary, #f59e0b);
    color: #000000;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    box-shadow: 
        0 4px 20px rgba(245, 158, 11, 0.3),
        0 0 40px rgba(245, 158, 11, 0.2);
    animation: glow-pulse 2s ease-in-out infinite;
}

.cookie-accept-all:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 30px rgba(245, 158, 11, 0.4),
        0 0 60px rgba(245, 158, 11, 0.3);
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(245, 158, 11, 0.3),
            0 0 40px rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: 
            0 4px 20px rgba(245, 158, 11, 0.4),
            0 0 50px rgba(245, 158, 11, 0.3);
    }
}

/* Manage Preferences - Secondary, less prominent */
.cookie-manage {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
}

.cookie-manage:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}



/* Preferences Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.cookie-modal-content {
    background: var(--bg-secondary, #1a1b1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

/* Modal Header */
.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0;
    text-transform: lowercase;
}

.cookie-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.cookie-modal-close:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: rotate(90deg);
}

/* Modal Body */
.cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cookie Category */
.cookie-category {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.cookie-category:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

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

.cookie-category-info {
    flex: 1;
}

.cookie-category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.25rem 0;
}

.cookie-category-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.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: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--aerraflow-primary, #f59e0b);
}

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

.cookie-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle.disabled .cookie-toggle-slider {
    cursor: not-allowed;
}

/* Modal Footer */
.cookie-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cookie-save {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-save:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

/* Reject button in modal - subtle styling */
.cookie-reject-modal {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0.5rem 1rem;
}

.cookie-reject-modal:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookie-banner {
        left: 0;
        right: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .cookie-content {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        padding: 1rem;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    
    .cookie-text {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        order: 1;
    }
    
    .cookie-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
        word-wrap: break-word;
    }
    
    .cookie-description {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        word-wrap: break-word;
        line-height: 1.4;
    }
    
    .cookie-policy-link {
        font-size: 0.8rem;
        word-break: break-word;
        display: block;
        margin-top: 0.25rem;
    }
    
    .cookie-actions {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        order: 2;
        margin-top: auto;
    }
    
    .cookie-btn {
        flex: 1;
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        min-width: 0;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .cookie-accept-all {
        font-size: 0.9rem;
        padding: 0.875rem 0.75rem;
        flex: 1.3;
        font-weight: 700;
    }
    
    .cookie-manage {
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
        flex: 1;
    }
    
    .cookie-modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        width: calc(100% - 1rem);
        max-width: calc(100vw - 1rem);
        box-sizing: border-box;
    }
    
    /* Modal header mobile */
    .cookie-modal-header {
        padding: 1rem;
    }
    
    .cookie-modal-title {
        font-size: 1.1rem;
    }
    
    /* Modal body mobile */
    .cookie-modal-body {
        padding: 1rem;
    }
    
    .cookie-modal-intro {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .cookie-category {
        padding: 0.75rem;
    }
    
    .cookie-category-name {
        font-size: 0.9rem;
    }
    
    .cookie-category-desc {
        font-size: 0.8rem;
    }
    
    /* Modal footer mobile fixes */
    .cookie-modal-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        align-items: stretch;
    }
    
    .cookie-modal-footer .cookie-btn {
        width: 100%;
        margin: 0;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        text-align: center;
        box-sizing: border-box;
    }
    
    /* Button order for mobile */
    .cookie-reject-modal {
        order: 3;
        font-size: 0.85rem;
        padding: 0.625rem 1rem;
    }
    
    .cookie-save {
        order: 2;
    }
    
    .cookie-modal-footer .cookie-accept-all {
        order: 1;
        font-weight: 700;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .cookie-content {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .cookie-actions {
        gap: 0.375rem;
    }
    
    .cookie-btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .cookie-accept-all {
        font-size: 0.85rem;
        padding: 0.625rem 0.5rem;
    }
    
    .cookie-manage {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
    
    /* Modal footer for very small screens */
    .cookie-modal-footer {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .cookie-modal-footer .cookie-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .cookie-reject-modal {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Accessibility */
.cookie-banner:focus-within,
.cookie-modal:focus-within {
    outline: 2px solid var(--aerraflow-primary, #f59e0b);
    outline-offset: 2px;
}

.cookie-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider {
    outline: 2px solid var(--aerraflow-primary, #f59e0b);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-backdrop,
    .cookie-banner,
    .cookie-modal,
    .cookie-btn,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none;
    }
    
    @keyframes glow-pulse {
        0%, 100% {
            box-shadow: 
                0 4px 20px rgba(245, 158, 11, 0.3),
                0 0 40px rgba(245, 158, 11, 0.2);
        }
    }
} 