/* ============================================================================
   COOKIE CONSENT BANNER
   A modern, accessible cookie consent component
   ============================================================================ */

/* Banner Container */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease;
}

.cookie-consent-banner.visible {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent-banner.hiding {
    transform: translateY(100%);
    opacity: 0;
}

/* Inner Container */
.cookie-consent-inner {
    background: linear-gradient(135deg, rgba(0, 52, 73, 0.98) 0%, rgba(0, 80, 95, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 177, 183, 0.3);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    padding: 20px 30px;
}

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

/* Cookie Icon */
.cookie-consent-icon {
    font-size: 2.5rem;
    animation: cookieFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

@keyframes cookieFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

/* Text Content */
.cookie-consent-text {
    flex: 1;
    min-width: 280px;
}

.cookie-consent-text h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-consent-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.cookie-consent-text a {
    color: #00d4db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-consent-text a:hover {
    color: #ffd700;
    text-decoration: underline;
}

/* Buttons Container */
.cookie-consent-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Button Base Styles */
.cookie-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Accept All Button */
.cookie-consent-btn.accept-all {
    background: linear-gradient(135deg, #00b1b7 0%, #00d4db 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 177, 183, 0.4);
}

.cookie-consent-btn.accept-all:hover {
    background: linear-gradient(135deg, #00c9d0 0%, #00e5ec 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 177, 183, 0.5);
}

.cookie-consent-btn.accept-all:active {
    transform: translateY(0);
}

/* Essential Only Button */
.cookie-consent-btn.essential-only {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-consent-btn.essential-only:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Customize Button */
.cookie-consent-btn.customize {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 16px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-consent-btn.customize:hover {
    color: #ffd700;
}

/* 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;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.cookie-preferences-content {
    background: linear-gradient(135deg, #003449 0%, #00505f 100%);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 177, 183, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

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

.cookie-preferences-header h3 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-preferences-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-preferences-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Modal Body */
.cookie-preferences-body {
    padding: 24px;
}

.cookie-category {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

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

.cookie-category-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.cookie-category-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 48px;
    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);
    border-radius: 26px;
    transition: 0.3s;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #00b1b7 0%, #00d4db 100%);
}

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

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

/* Required Badge */
.cookie-required-badge {
    background: rgba(0, 177, 183, 0.2);
    color: #00d4db;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Footer */
.cookie-preferences-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Scrollbar Styling */
.cookie-preferences-content::-webkit-scrollbar {
    width: 8px;
}

.cookie-preferences-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.cookie-preferences-content::-webkit-scrollbar-thumb {
    background: rgba(0, 177, 183, 0.3);
    border-radius: 10px;
}

.cookie-preferences-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 177, 183, 0.5);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cookie-consent-inner {
        padding: 16px 20px;
    }

    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .cookie-consent-icon {
        font-size: 2rem;
    }

    .cookie-consent-text {
        min-width: auto;
    }

    .cookie-consent-text h3 {
        justify-content: center;
        font-size: 1rem;
    }

    .cookie-consent-text p {
        font-size: 0.85rem;
    }

    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-consent-btn {
        width: 100%;
    }

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

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

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

/* ============================================================================
   COOKIE REQUIRED TOAST
   Shown when user tries to use a feature that requires cookie consent
   ============================================================================ */

.cookie-required-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 10001;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    pointer-events: none;
}

.cookie-required-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-required-toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 183, 77, 0.4);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 183, 77, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    max-width: 500px;
    animation: toastShake 0.5s ease-in-out;
}

@keyframes toastShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.cookie-required-toast-icon {
    font-size: 2rem;
    animation: cookieBounce 1s ease-in-out infinite;
}

@keyframes cookieBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.cookie-required-toast-text {
    flex: 1;
}

.cookie-required-toast-text strong {
    display: block;
    color: #ffb74d;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.cookie-required-toast-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.cookie-required-toast-btn {
    background: linear-gradient(135deg, #00b1b7 0%, #00d4db 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 177, 183, 0.3);
}

.cookie-required-toast-btn:hover {
    background: linear-gradient(135deg, #00c9d0 0%, #00e5ec 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 177, 183, 0.4);
}

.cookie-required-toast-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cookie-required-toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Banner Highlight Animation (when user tries to use feature without consent) */
.cookie-consent-banner.highlight {
    animation: bannerHighlight 0.6s ease-in-out;
}

.cookie-consent-banner.highlight .cookie-consent-inner {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(255, 183, 77, 0.5);
    border-top-color: rgba(255, 183, 77, 0.8);
}

@keyframes bannerHighlight {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

/* Responsive Toast */
@media (max-width: 520px) {
    .cookie-required-toast {
        left: 10px;
        right: 10px;
        transform: translateX(0) translateY(-100px);
    }

    .cookie-required-toast.visible {
        transform: translateX(0) translateY(0);
    }

    .cookie-required-toast-content {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    .cookie-required-toast-icon {
        font-size: 1.5rem;
    }

    .cookie-required-toast-text {
        flex: 1;
        min-width: 150px;
    }

    .cookie-required-toast-btn {
        width: 100%;
        order: 5;
    }

    .cookie-required-toast-close {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
    }
}

