/* ==============================================================================
   AISLAMIENTO SPAIN — UNIFIED NAVIGATION & ELENA MARTÍN ASSISTANT STYLES
   Compatible con páginas Tailwind y páginas Vanilla CSS (site.css)
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ---------- 1. Site Header & Capsule Navigation (Universal) ---------- */
#site-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 900;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#site-header.glass-nav-xui,
#site-header.shadow-md {
    background-color: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
}

#site-header > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 0.5rem;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    #site-header > div {
        padding-left: 2rem;
        padding-right: 2rem;
        gap: 1rem;
    }
}

/* Brand Logo inside Site Header */
#site-header a[aria-label*="Inicio"] {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: #0f172a;
}

#site-header a[aria-label*="Inicio"] img {
    height: 2.75rem;
    width: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    display: block;
}

/* Hamburger Button */
#menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 2.75rem;
    height: 2.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 0;
    margin: 0;
}

#menu-toggle span {
    display: block;
    width: 1.25rem;
    height: 2px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

#menu-toggle span:nth-child(1),
#menu-toggle span:nth-child(3) {
    background-color: #1a1c1c;
}

#menu-toggle span:nth-child(2) {
    background-color: #10b981;
}

#menu-toggle span:not(:last-child) {
    margin-bottom: 0.375rem;
}

@media (min-width: 1024px) {
    #menu-toggle {
        display: none !important;
    }
}

/* Desktop Nav Visibility */
@media (max-width: 1023px) {
    #site-header nav.glass-nav-xui {
        display: none !important;
    }
    #site-header .open-modal-btn {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    #site-header nav.glass-nav-xui {
        display: flex !important;
        align-items: center;
        border-radius: 9999px;
        padding: 0.375rem 1.25rem;
        gap: 0.625rem;
        white-space: nowrap;
    }
    #site-header .open-modal-btn {
        display: flex !important;
        align-items: center;
        gap: 0.375rem;
    }
}

/* ---------- 2. Dropdown Navigation Styling (Desktop Capsule) ---------- */
.glass-nav-xui {
    background-color: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.glass-nav-xui > a,
.glass-nav-xui .dropdown-trigger {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 9999px;
    transition: all 0.2s ease;
    color: #1a1c1c;
    opacity: 0.85;
}

.glass-nav-xui .dropdown-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.glass-nav-xui .dropdown-trigger:hover,
.glass-nav-xui .dropdown-container:hover .dropdown-trigger,
.glass-nav-xui .dropdown-container.is-active .dropdown-trigger {
    color: #10b981 !important;
    opacity: 1 !important;
}

.dropdown-menu,
.glass-nav-xui .dropdown-menu {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    padding-top: 10px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
    z-index: 1000 !important;
    white-space: normal !important;
}

.dropdown-container:hover > .dropdown-menu,
.dropdown-container.is-active > .dropdown-menu,
.glass-nav-xui .dropdown-container:hover > .dropdown-menu,
.glass-nav-xui .dropdown-container.is-active > .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) !important;
}

.glass-nav-xui .dropdown-panel {
    background-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1.25rem;
    padding: 0.65rem;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
    min-width: 290px;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-sizing: border-box;
}

.glass-nav-xui .dropdown-panel.dropdown-panel-wide {
    min-width: 330px;
}

.glass-nav-xui .dropdown-panel a {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    padding: 0.55rem 0.75rem !important;
    border-radius: 0.75rem !important;
    text-transform: none !important;
    text-align: left !important;
    color: #1a1c1c !important;
    transition: all 0.15s ease !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    text-decoration: none !important;
    box-sizing: border-box;
}

.glass-nav-xui .dropdown-panel a:hover {
    background-color: #f0fdf4 !important;
    transform: translateX(3px) !important;
}

.glass-nav-xui .dropdown-panel a .item-icon {
    width: 28px;
    height: 28px;
    border-radius: 0.5rem;
    background: #f1f5f9;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    transition: background 0.15s ease, color 0.15s ease;
}

.glass-nav-xui .dropdown-panel a:hover .item-icon {
    background: #10b981;
    color: #ffffff;
}

.glass-nav-xui .dropdown-panel a .item-title {
    display: block;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.glass-nav-xui .dropdown-panel a:hover .item-title {
    color: #059669;
}

.glass-nav-xui .dropdown-panel a .item-desc {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.3;
    margin-top: 2px;
}

.glass-nav-xui .dropdown-panel a:hover .item-desc {
    color: #334155;
}

.glass-nav-xui .dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0.25rem 0.5rem;
}

/* ---------- 3. Mobile Console Drawer (#mobile-menu) ---------- */
#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: rgba(22, 23, 25, 0.96);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    color: #ffffff;
    box-sizing: border-box;
}

#mobile-menu:not(.translate-x-full) {
    transform: translateX(0) !important;
}

@media (min-width: 1024px) {
    #mobile-menu {
        display: none !important;
    }
}

#mobile-menu details {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.75rem;
    margin-bottom: 0.625rem;
    overflow: hidden;
}

#mobile-menu details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    font-size: 0.75rem;
    list-style: none;
    user-select: none;
}

#mobile-menu details summary::-webkit-details-marker {
    display: none;
}

#mobile-menu details[open] summary {
    color: #10b981;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#mobile-menu details div a {
    display: block;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

#mobile-menu details div a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #10b981;
}

/* ---------- 4. LED Indicators & Action Buttons ---------- */
.pulse-led-green {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green-anim 2s infinite;
    -webkit-animation: pulse-green-anim 2s infinite;
}

@keyframes pulse-green-anim {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.xui-btn-primary {
    background: #10b981;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    color: #ffffff !important;
}

.xui-btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

/* ---------- 5. Virtual Assistant Elena Martín Styling ---------- */
#schaffner-assistant-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

#assistant-bubble {
    position: absolute;
    bottom: 5rem;
    right: 0;
    margin-bottom: 0.75rem;
    width: 22rem;
    max-width: calc(100vw - 3rem);
    padding: 0.875rem;
    border-radius: 1rem;
    background: rgba(22, 23, 25, 0.95);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(8px);
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    box-sizing: border-box;
}

#assistant-bubble.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

#assistant-chat-window {
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 600px;
    max-height: 85vh;
    border-radius: 1.5rem;
    background: #161719;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #ffffff;
    transform: scale(0.95);
    opacity: 0;
    margin-bottom: 1rem;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-sizing: border-box;
}

#assistant-chat-window.is-open {
    transform: scale(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
}

#assistant-chat-window.hidden {
    display: none !important;
}

#chat-messages-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #161719;
    box-sizing: border-box;
}

#chat-messages-container::-webkit-scrollbar {
    width: 5px;
}

#chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

#chat-input-form {
    padding: 0.75rem;
    background: #111214;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

#chat-user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.75rem;
    color: #ffffff;
    outline: none;
    box-sizing: border-box;
}

#chat-user-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}

#chat-input-form button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #10b981;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

#chat-input-form button:hover {
    background: #059669;
}

/* Assistant Launch Toggle Button */
#assistant-toggle-btn {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #161719 0%, #23262d 50%, #10b981 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

#assistant-toggle-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.6);
}

#scroll-to-top-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    background: rgba(31, 33, 38, 0.9);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#scroll-to-top-btn:hover {
    background: #10b981;
    color: #ffffff;
    border-color: rgba(16, 185, 129, 0.5);
}

.agent-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.agent-action-chip:hover {
    background: #10b981;
    color: #ffffff;
    transform: translateY(-1px);
}

.quick-chip-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.quick-chip-btn:hover {
    background: #10b981;
    color: #ffffff;
}

.scrollbar-thin::-webkit-scrollbar {
    height: 4px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}
