/* ===== Cookie Banner Styles ===== */

/* Cookie Banner Container */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--white) 0%, rgba(245, 245, 245, 0.98) 100%);
    border-top: 3px solid var(--primary-orange);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    z-index: 998; /* Below chatbot but above everything else */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: 'Poppins', sans-serif;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner.hide {
    transform: translateY(100%);
}

/* Cookie Content */
.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cookie Info Section */
.cookie-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cookie-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-orange), #e66a1f);
    border-radius: 12px;
    color: var(--white);
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255, 127, 50, 0.3);
}

.cookie-text {
    flex: 1;
}

.cookie-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.cookie-description {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin: 0;
    line-height: 1.5;
}

.cookie-description a {
    color: var(--primary-orange);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.3s ease;
}

.cookie-description a:hover {
    color: var(--primary-blue);
}

/* Cookie Actions */
.cookie-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Cookie Buttons */
.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.cookie-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.cookie-btn:hover::before {
    width: 200px;
    height: 200px;
}

/* Accept Button */
.cookie-btn.accept {
    background: linear-gradient(135deg, var(--primary-orange), #e66a1f);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 127, 50, 0.3);
}

.cookie-btn.accept:hover {
    background: linear-gradient(135deg, #e66a1f, #d55f1a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 127, 50, 0.4);
}

/* Decline Button */
.cookie-btn.decline {
    background: transparent;
    color: var(--text-gray);
    border: 2px solid rgba(102, 102, 102, 0.3);
}

.cookie-btn.decline:hover {
    background: var(--text-gray);
    color: var(--white);
    border-color: var(--text-gray);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 102, 102, 0.3);
}

/* Settings Button */
.cookie-btn.settings {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid rgba(35, 41, 98, 0.3);
    padding: 0.6rem 1.2rem;
}

.cookie-btn.settings:hover {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(35, 41, 98, 0.3);
}

/* Close Button */
.cookie-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: none; /* Hidden by default */
}

.cookie-close:hover {
    color: var(--primary-orange);
    background: rgba(255, 127, 50, 0.1);
    transform: rotate(90deg);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

.cookie-settings-modal.show {
    display: flex;
}

.cookie-settings-content {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-settings-modal.show .cookie-settings-content {
    transform: scale(1);
}

.cookie-settings-header {
    margin-bottom: 2rem;
    text-align: center;
}

.cookie-settings-header h3 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.cookie-settings-header p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0;
}

/* Cookie Categories */
.cookie-category {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(35, 41, 98, 0.1);
    border-radius: 12px;
    background: rgba(245, 245, 245, 0.3);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cookie-category-title {
    color: var(--primary-blue);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.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-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--primary-orange);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: var(--primary-blue);
    cursor: not-allowed;
}

.cookie-category-description {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Cookie Settings Actions */
.cookie-settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(35, 41, 98, 0.1);
}

.cookie-settings-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-settings-close:hover {
    color: var(--primary-orange);
    background: rgba(255, 127, 50, 0.1);
    transform: rotate(90deg);
}

/* ===== Responsive Design ===== */

/* Tablets */
@media screen and (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        text-align: center;
    }
    
    .cookie-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .cookie-title {
        font-size: 1rem;
    }
    
    .cookie-description {
        font-size: 0.85rem;
    }
    
    .cookie-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .cookie-btn {
        padding: 0.7rem 1.3rem;
        font-size: 0.85rem;
    }
    
    .cookie-settings-modal {
        padding: 1rem;
    }
    
    .cookie-settings-content {
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .cookie-category {
        padding: 1.25rem;
    }
    
    .cookie-settings-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Mobile Devices */
@media screen and (max-width: 480px) {
    .cookie-content {
        padding: 1.25rem 1rem;
        gap: 1.25rem;
    }
    
    .cookie-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .cookie-title {
        font-size: 0.95rem;
    }
    
    .cookie-description {
        font-size: 0.8rem;
    }
    
    .cookie-actions {
        width: 100%;
        gap: 0.5rem;
    }
    
    .cookie-btn {
        flex: 1;
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
        min-height: 44px; /* Touch target */
    }
    
    .cookie-btn.settings {
        flex: none;
        padding: 0.55rem 1rem;
    }
    
    .cookie-close {
        display: block;
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1rem;
        padding: 0.25rem;
    }
    
    .cookie-settings-modal {
        padding: 0.5rem;
    }
    
    .cookie-settings-content {
        padding: 1.25rem;
        border-radius: 15px;
    }
    
    .cookie-settings-header h3 {
        font-size: 1.3rem;
    }
    
    .cookie-category {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .cookie-toggle {
        align-self: flex-end;
    }
    
    .cookie-category-title {
        font-size: 1rem;
    }
    
    .cookie-category-description {
        font-size: 0.85rem;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 360px) {
    .cookie-content {
        padding: 1rem 0.75rem;
    }
    
    .cookie-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-settings-content {
        padding: 1rem;
        max-height: 90vh;
    }
    
    .cookie-category {
        padding: 0.75rem;
    }
}

/* High Resolution Displays */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    .cookie-icon,
    .cookie-btn,
    .cookie-toggle-slider {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-btn,
    .cookie-settings-content,
    .cookie-toggle-slider,
    .cookie-close,
    .cookie-settings-close {
        transition: none !important;
        animation: none !important;
    }
    
    .cookie-btn:hover,
    .cookie-close:hover,
    .cookie-settings-close:hover {
        transform: none !important;
    }
    
    .cookie-btn::before {
        display: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .cookie-btn,
    .cookie-close,
    .cookie-settings-close {
        min-height: 44px;
        min-width: 44px;
    }
    
    .cookie-btn:hover,
    .cookie-close:hover,
    .cookie-settings-close:hover {
        transform: none;
    }
    
    .cookie-btn:active {
        transform: scale(0.98);
    }
    
    .cookie-close:active,
    .cookie-settings-close:active {
        transform: scale(0.9);
    }
}

/* Print Styles */
@media print {
    .cookie-banner,
    .cookie-settings-modal {
        display: none !important;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* 
    Add dark mode styles if needed
    Currently keeping light theme for consistency
    */
}

/* Landscape Orientation */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .cookie-banner {
        position: relative;
        transform: none;
    }
    
    .cookie-banner.show {
        transform: none;
    }
    
    .cookie-content {
        padding: 1rem 1.5rem;
    }
    
    .cookie-settings-modal {
        padding: 1rem;
    }
    
    .cookie-settings-content {
        max-height: 90vh;
        padding: 1.5rem;
    }
}

/* Ensure cookie banner doesn't interfere with chatbot */
body:has(.cookie-banner.show) .chatbot-float {
    bottom: calc(15px + var(--cookie-banner-height, 120px));
    transition: bottom 0.4s ease;
}

body:has(.cookie-banner.show) .chatbot-window {
    bottom: calc(80px + var(--cookie-banner-height, 120px));
    transition: bottom 0.4s ease;
}

/* Cookie banner height calculation for different screen sizes */
@media screen and (max-width: 768px) {
    body:has(.cookie-banner.show) {
        --cookie-banner-height: 160px;
    }
}

@media screen and (max-width: 480px) {
    body:has(.cookie-banner.show) {
        --cookie-banner-height: 180px;
    }
}