/* ========================================
   Cookie Banner & Chatbot Widget Styles
   ======================================== */

/* ========================================
   Cookie Banner
   ======================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-bg-secondary);
    border-top: 2px solid var(--color-border);
    box-shadow: 0 -4px 20px var(--color-shadow-strong);
    padding: var(--space-md);
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform var(--transition-medium);
}

.cookie-banner.active {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text h3 {
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-h4);
}

.cookie-banner-text p {
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-small);
    line-height: 1.5;
}

.cookie-banner-text a {
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

.cookie-btn {
    padding: var(--space-xs) var(--space-md);
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family-primary);
}

.cookie-btn-primary {
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
}

.cookie-btn-primary:hover,
.cookie-btn-primary:focus {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
}

.cookie-btn-secondary {
    background-color: transparent;
    color: var(--color-text-primary);
    border: 2px solid var(--color-border);
}

.cookie-btn-secondary:hover,
.cookie-btn-secondary:focus {
    background-color: var(--color-bg-tertiary);
}

.cookie-btn:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: calc(var(--z-modal) + 10);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.cookie-settings-modal.active {
    display: flex;
}

.cookie-settings-content {
    background-color: var(--color-bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px var(--color-shadow-strong);
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.cookie-settings-header h2 {
    margin: 0;
}

.cookie-settings-close {
    width: 40px;
    height: 40px;
    border: none;
    background-color: transparent;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.cookie-settings-close:hover,
.cookie-settings-close:focus {
    background-color: var(--color-bg-tertiary);
}

.cookie-category {
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-sm);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.cookie-category-title {
    font-weight: 600;
    font-size: var(--font-size-h4);
}

.cookie-category-description {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

/* 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-color: var(--color-border);
    border-radius: 26px;
    transition: background-color var(--transition-fast);
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.cookie-toggle input:checked+.cookie-toggle-slider {
    background-color: var(--color-accent);
}

.cookie-toggle input:checked+.cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled+.cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle input:focus-visible+.cookie-toggle-slider {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.cookie-settings-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    justify-content: flex-end;
}

/* ========================================
   Chatbot Widget
   ======================================== */
.chatbot-widget {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-popover);
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    color: var(--color-bg-primary);
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--color-shadow-strong);
    transition: all var(--transition-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--color-shadow-strong);
}

.chatbot-toggle:focus-visible {
    outline: 3px solid var(--color-accent-hover);
    outline-offset: 3px;
}

.chatbot-toggle .icon-close {
    display: none;
}

.chatbot-toggle.active .icon-chat {
    display: none;
}

.chatbot-toggle.active .icon-close {
    display: block;
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 2 * var(--space-lg));
    height: 500px;
    max-height: 70vh;
    background-color: var(--color-bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 50px var(--color-shadow-strong);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: chatbotSlideIn var(--transition-medium) ease-out;
}

.chatbot-window.active {
    display: flex;
}

@keyframes chatbotSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chatbot-header {
    padding: var(--space-md);
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--color-bg-primary);
}

.chatbot-info p {
    margin: 0;
    font-size: var(--font-size-small);
    opacity: 0.9;
}

.chatbot-body {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
    background-color: var(--color-bg-secondary);
}

.chatbot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--color-text-secondary);
}

.chatbot-placeholder-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.chatbot-placeholder h4 {
    margin-bottom: var(--space-sm);
}

.chatbot-placeholder p {
    font-size: var(--font-size-small);
    max-width: 250px;
    margin-bottom: var(--space-md);
}

.chatbot-contact-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    max-width: 280px;
}

.chatbot-contact-btn {
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--border-radius-sm);
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    text-decoration: none;
}

.chatbot-contact-btn:hover,
.chatbot-contact-btn:focus {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--color-shadow);
}

.chatbot-contact-btn i {
    font-size: 1.25rem;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

/* Tablet */
@media screen and (max-width: 1024px) {
    .chatbot-window {
        width: 340px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .cookie-banner-content {
        padding: var(--space-sm);
    }

    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-btn {
        width: 100%;
    }

    .chatbot-widget {
        bottom: var(--space-md);
        right: var(--space-md);
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }

    .chatbot-window {
        width: calc(100vw - 2 * var(--space-md));
        max-width: none;
        height: 450px;
    }

    .cookie-settings-content {
        max-height: 90vh;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .chatbot-window {
        bottom: 70px;
        right: var(--space-xs);
        left: var(--space-xs);
        width: auto;
        height: 400px;
    }
}