/* Explain: Styles for UI components including headers, panels, buttons, forms, AI assistant, and WhatsApp widget. */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-color);
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.section-kicker::before {
    display: inline-block;
    width: 3rem;
    height: 2px;
    background: var(--accent-color);
    content: "";
}

.glass-panel {
    border: 1px solid var(--glass-border);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(248, 250, 252, 0.95));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    position: relative;
}

.glass-panel::before {
    content: "";
    position: absolute;
    top: -1px; left: -1px;
    width: 20px; height: 20px;
    border-top: 2px solid var(--accent-color);
    border-left: 2px solid var(--accent-color);
    pointer-events: none;
}

.arch-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.arch-frame::after {
    position: absolute;
    inset: 0.75rem;
    border: 1px solid rgba(255, 107, 0, 0.3);
    content: "";
    pointer-events: none;
}

.arch-frame-large {
    height: min(74vh, 720px);
    min-height: 500px;
}

.arch-frame-medium {
    height: 620px;
    max-width: 450px;
}

/* Force sharp corners */
.rounded-full, .rounded-2xl, .rounded-3xl, .rounded-t-\[2\.2rem\], .arch-frame-large, .arch-frame-medium, .amenity-image-wrap {
    border-radius: 0 !important;
}

/* Chamfered buttons */
.btn {
    border-radius: 0 !important;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.input, .textarea, .select {
    border-radius: 0 !important;
    border: 1px solid var(--border-color);
}

.floating-note {
    position: absolute;
    right: -1.5rem;
    bottom: 4rem;
    display: flex;
    max-width: 250px;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.2rem;
    color: var(--text-color);
    font-size: 0.82rem;
    font-weight: 600;
}

.story-card {
    position: absolute;
    right: 0;
    bottom: 2.5rem;
    max-width: 290px;
    padding: 1.5rem;
}

.quiet-detail,
.amenity-row,
.contact-note {
    border: 1px solid var(--glass-border);
    background: rgba(241, 245, 249, 0.6);
    padding: 1.25rem;
    position: relative;
}

.quiet-detail::before, .amenity-row::before {
    content: "";
    position: absolute;
    top: -1px; right: -1px;
    width: 10px; height: 10px;
    border-top: 1px solid var(--accent-color);
    border-right: 1px solid var(--accent-color);
    pointer-events: none;
}

.quiet-detail span {
    display: inline-flex;
    margin-bottom: 0.9rem;
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
}

.quiet-detail p {
    color: var(--text-muted);
    font-size: 1.125rem;
    line-height: 1.8;
}

.class-card {
    min-height: 360px;
    padding: 2rem;
    transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.class-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 10px 40px rgba(255, 107, 0, 0.15);
    transform: translateY(-4px);
}

.amenity-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
}

.amenity-dot {
    width: 0.6rem;
    height: 0.6rem;
    margin-top: 0.5rem;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

.amenity-image-wrap {
    height: 660px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.booking-form,
.booking-overlay-panel {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.form-label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--text-color);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.form-status.success {
    color: #10B981;
}

.form-status.error {
    color: #EF4444;
}

.mobile-book-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    border-top: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
}

.booking-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.booking-overlay.is-open {
    display: block;
}

.booking-overlay-panel {
    min-height: calc(100vh - 2rem);
    background: var(--background-color);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
}

.image-marquee {
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.image-marquee-track {
    display: flex;
    width: max-content;
    gap: 1rem;
    animation: image-marquee-scroll 46s linear infinite;
    will-change: transform;
}

.image-marquee:hover .image-marquee-track,
.image-marquee:focus-within .image-marquee-track {
    animation-play-state: paused;
}

.marquee-card {
    flex: 0 0 auto;
    width: clamp(14rem, 24vw, 20rem);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--glass-border);
    background: var(--background-color);
    box-shadow: var(--shadow-soft);
}

.marquee-card img {
    transition: transform 500ms ease;
}

.marquee-card:hover img {
    transform: scale(1.04);
}

@keyframes image-marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .image-marquee {
        overflow-x: auto;
        mask-image: none;
    }
    .image-marquee-track {
        animation: none;
        padding-bottom: 0.35rem;
    }
}

@media (max-width: 767px) {
    .section-kicker::before {
        width: 1.6rem;
    }

    .arch-frame-large,
    .arch-frame-medium,
    .amenity-image-wrap {
        height: 510px;
        min-height: 0;
    }

    .arch-frame-large {
        margin-right: auto;
        margin-left: auto;
        width: min(100%, 450px);
    }

    .floating-note,
    .story-card {
        position: relative;
        right: auto;
        bottom: auto;
        margin: -2.5rem auto 0;
    }

    .image-marquee {
        mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    }

    .image-marquee-track {
        gap: 0.75rem;
        animation-duration: 38s;
    }

    .marquee-card {
        width: min(76vw, 19rem);
    }
}

.ai-assistant-widget {
    direction: rtl;
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 55;
    font-family: var(--font-body);
}

.ai-assistant-launcher {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text-color);
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    transition: border-color 300ms ease, transform 300ms ease, background 300ms ease;
}

.ai-assistant-launcher:hover,
.ai-assistant-launcher:focus-visible {
    border-color: var(--accent-color);
    background: var(--surface-color);
    transform: translateY(-2px);
    outline: none;
}

.ai-assistant-panel {
    position: fixed;
    right: 1rem;
    bottom: 5.25rem;
    display: none;
    width: min(calc(100vw - 2rem), 25rem);
    max-height: min(42rem, calc(100dvh - 7rem));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.ai-assistant-panel.is-open {
    display: flex;
}

.ai-assistant-messages {
    display: grid;
    gap: 0.75rem;
    overflow-y: auto;
    padding: 1rem;
}

.ai-message {
    max-width: 92%;
    border: 1px solid var(--glass-border);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    line-height: 1.75;
}

.ai-message-bot {
    justify-self: start;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-color);
}

.ai-message-user {
    justify-self: end;
    border-color: rgba(255, 107, 0, 0.35);
    background: rgba(255, 107, 0, 0.14);
    color: var(--text-color);
}

.ai-suggestion {
    min-height: 2.5rem;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.02);
    padding: 0.6rem 0.8rem;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: right;
    transition: border-color 300ms ease, background 300ms ease;
}

.ai-suggestion:hover,
.ai-suggestion:focus-visible {
    border-color: var(--accent-color);
    background: rgba(255, 107, 0, 0.1);
    outline: none;
}

@media (max-width: 767px) {
    .ai-assistant-widget {
        right: 1rem;
        bottom: 5.7rem;
    }

    .ai-assistant-panel {
        right: 0.75rem;
        bottom: 9.75rem;
        width: calc(100vw - 1.5rem);
        max-height: calc(100dvh - 11rem);
    }
}

/* WhatsApp Widget */
.whatsapp-widget {
    position: fixed;
    left: 1rem;
    bottom: 5.5rem;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #25D366;
    color: white !important;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-size: 2rem;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.whatsapp-widget:hover,
.whatsapp-widget:focus-visible {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    outline: none;
}

@media (max-width: 767px) {
    .whatsapp-widget {
        bottom: 6rem;
    }
}

/* Waze Widget */
.waze-widget {
    position: fixed;
    left: 1rem;
    bottom: 9.5rem;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #33ccff;
    color: white !important;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-size: 2rem;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.waze-widget:hover,
.waze-widget:focus-visible {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(51, 204, 255, 0.4);
    outline: none;
}

@media (max-width: 767px) {
    .waze-widget {
        bottom: 10rem;
    }
}

/* Accessibility Widget Styles */
html.a11y-high-contrast {
    filter: invert(1) hue-rotate(180deg);
}
html.a11y-high-contrast img,
html.a11y-high-contrast video,
html.a11y-high-contrast iframe,
html.a11y-high-contrast #accessibilityWidget {
    filter: invert(1) hue-rotate(180deg);
}

body.a11y-highlight-links a {
    text-decoration: underline !important;
    text-decoration-color: #FF6B00 !important;
    text-decoration-thickness: 3px !important;
    background-color: rgba(255, 107, 0, 0.1) !important;
    color: #FF6B00 !important;
    font-weight: bold !important;
}

body.a11y-readable-font, 
body.a11y-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.05em !important;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.cookie-banner-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
}

@media (min-width: 768px) {
    .cookie-banner-content {
        flex-direction: row;
        text-align: right;
    }
    [dir="ltr"] .cookie-banner-content {
        text-align: left;
    }
}