/* ==========================================================
   Welcome Book — Guest-Facing Styles (Mobile-First)
   ========================================================== */

:root {
    --cas-wb-accent: #2563eb;
    --cas-wb-bg: #ffffff;
    --cas-wb-text: #1a1a1a;
    --cas-wb-muted: #6b7280;
    --cas-wb-border: #e5e7eb;
    --cas-wb-surface: #f9fafb;
    --cas-wb-radius: 12px;
    --cas-wb-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.cas-wb {
    font-family: var(--cas-wb-font);
    color: var(--cas-wb-text);
    background: var(--cas-wb-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

.cas-wb-container {
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* Hero
   --------------------------------------------------------- */
.cas-wb-hero {
    position: relative;
    min-height: auto;
    background: linear-gradient(135deg, var(--cas-wb-accent), #1e40af);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.cas-wb-hero[style*="background-image"] {
    height: 240px;
}

.cas-wb-hero-overlay {
    width: 100%;
    padding: 24px 20px;
    color: #fff;
    border-radius: 0 0 var(--cas-wb-radius) var(--cas-wb-radius);
}

.cas-wb-hero[style*="background-image"] .cas-wb-hero-overlay {
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

.cas-wb-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.cas-wb-host {
    font-size: 14px;
    margin-top: 6px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cas-wb-host-photo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
}

/* Welcome Message
   --------------------------------------------------------- */
.cas-wb-welcome {
    padding: 20px;
    border-bottom: 1px solid var(--cas-wb-border);
}

.cas-wb-welcome-text {
    font-size: 15px;
    color: var(--cas-wb-muted);
    line-height: 1.7;
}

/* WiFi Quick Access (below hero)
   --------------------------------------------------------- */
.cas-wb-wifi-quick {
    padding: 16px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cas-wb-wifi-quick-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--cas-wb-surface);
    border: 1px solid var(--cas-wb-border);
    border-radius: var(--cas-wb-radius);
}

.cas-wb-wifi-quick-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cas-wb-wifi-quick-icon {
    font-size: 22px;
    line-height: 1;
}

.cas-wb-wifi-quick-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.cas-wb-wifi-quick-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--cas-wb-text);
}

.cas-wb-wifi-quick-info .cas-wb-wifi-row {
    justify-content: center;
}

.cas-wb-wifi-quick-info .cas-wb-wifi-label {
    min-width: auto;
    text-align: right;
}

.cas-wb-wifi-quick-info .cas-wb-wifi-value {
    flex: 0 1 auto;
}

/* Weather & Time Widgets
   --------------------------------------------------------- */
.cas-wb-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 20px;
}

.cas-wb-widget {
    background: var(--cas-wb-surface);
    border: 1px solid var(--cas-wb-border);
    border-radius: var(--cas-wb-radius);
    padding: 14px 16px;
}

.cas-wb-widget-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cas-wb-muted);
    margin-bottom: 12px;
}

.cas-wb-widget-header svg {
    stroke: var(--cas-wb-muted);
    flex-shrink: 0;
}

a.cas-wb-widget-weather {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.2s, box-shadow 0.2s;
}

a.cas-wb-widget-weather:hover {
    border-color: var(--cas-wb-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Weather widget */
.cas-wb-weather-loading {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.cas-wb-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--cas-wb-border);
    border-top-color: var(--cas-wb-accent);
    border-radius: 50%;
    animation: cas-wb-spin 0.8s linear infinite;
}

@keyframes cas-wb-spin {
    to { transform: rotate(360deg); }
}

.cas-wb-weather-now {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.cas-wb-weather-icon {
    flex-shrink: 0;
}

.cas-wb-weather-temp {
    display: flex;
    flex-direction: column;
}

.cas-wb-weather-deg {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--cas-wb-text);
}

.cas-wb-weather-desc {
    font-size: 12px;
    color: var(--cas-wb-muted);
    text-transform: capitalize;
}

.cas-wb-weather-forecast {
    display: flex;
    gap: 2px;
    justify-content: space-between;
}

.cas-wb-forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.cas-wb-forecast-day-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--cas-wb-muted);
    text-transform: capitalize;
}

.cas-wb-forecast-day img {
    width: 24px;
    height: 24px;
}

.cas-wb-forecast-day-temps {
    font-size: 10px;
    color: var(--cas-wb-text);
    white-space: nowrap;
}

.cas-wb-forecast-day-temps .hi {
    font-weight: 600;
}

.cas-wb-forecast-day-temps .lo {
    color: var(--cas-wb-muted);
}

/* Time widget */
.cas-wb-time-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cas-wb-time-clock {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: var(--cas-wb-text);
    letter-spacing: 0.02em;
}

.cas-wb-time-zone {
    font-size: 12px;
    color: var(--cas-wb-muted);
    margin-top: 2px;
}

/* Section Navigation (horizontal scroll on mobile)
   --------------------------------------------------------- */
.cas-wb-nav {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--cas-wb-border);
    position: sticky;
    top: 0;
    background: var(--cas-wb-bg);
    z-index: 10;
}

.cas-wb-nav::-webkit-scrollbar { display: none; }

.cas-wb-nav-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--cas-wb-muted);
    font-size: 11px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.cas-wb-nav-item:hover,
.cas-wb-nav-item:focus {
    background: var(--cas-wb-surface);
    color: var(--cas-wb-accent);
}

.cas-wb-nav-icon {
    font-size: 20px;
    line-height: 1;
}

/* Sections
   --------------------------------------------------------- */
.cas-wb-content {
    padding: 0 20px;
}

.cas-wb-section {
    border-bottom: 1px solid var(--cas-wb-border);
    scroll-margin-top: 60px;
}

.cas-wb-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.cas-wb-section-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.cas-wb-section-icon {
    font-size: 22px;
    line-height: 1;
}

.cas-wb-section-toggle {
    font-size: 12px;
    color: var(--cas-wb-muted);
    transition: transform 0.2s;
}

.cas-wb-section-header[aria-expanded="false"] .cas-wb-section-toggle {
    transform: rotate(-90deg);
}

.cas-wb-section-body {
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cas-wb-section-header[aria-expanded="false"] + .cas-wb-section-body {
    display: none;
}

/* Items
   --------------------------------------------------------- */
.cas-wb-item {
    padding: 12px 14px;
    background: var(--cas-wb-surface);
    border-radius: var(--cas-wb-radius);
}

.cas-wb-item-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
}

.cas-wb-item-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--cas-wb-text);
}

.cas-wb-item-content p { margin: 0 0 8px; }
.cas-wb-item-content p:last-child { margin-bottom: 0; }
.cas-wb-item-content ul, .cas-wb-item-content ol { padding-left: 20px; margin: 4px 0; }

/* WiFi item */
.cas-wb-wifi {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cas-wb-wifi-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cas-wb-wifi-label {
    font-size: 12px;
    color: var(--cas-wb-muted);
    min-width: 70px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.cas-wb-wifi-value {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.cas-wb-mono {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    letter-spacing: 0.05em;
}

/* Code item */
.cas-wb-code {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cas-wb-code-label {
    font-size: 14px;
    color: var(--cas-wb-muted);
}

.cas-wb-code-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--cas-wb-accent);
}

/* Copy button */
.cas-wb-copy-btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cas-wb-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s, border-color 0.15s;
}

.cas-wb-copy-btn:hover {
    background: var(--cas-wb-surface);
    border-color: var(--cas-wb-accent);
}

.cas-wb-copy-btn.copied {
    background: #d1fae5;
    border-color: #10b981;
}

/* Address, Phone, Link items */
.cas-wb-address,
.cas-wb-phone-number,
.cas-wb-link,
.cas-wb-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cas-wb-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.cas-wb-address:hover,
.cas-wb-phone-number:hover,
.cas-wb-link:hover,
.cas-wb-email:hover {
    text-decoration: underline;
}

.cas-wb-address svg,
.cas-wb-phone-number svg,
.cas-wb-link svg {
    fill: var(--cas-wb-accent);
    flex-shrink: 0;
}

.cas-wb-phone {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cas-wb-phone-label {
    font-size: 14px;
    color: var(--cas-wb-muted);
    min-width: 80px;
}

/* Chat CTA (floating button — matches support widget style)
   --------------------------------------------------------- */
.cas-wb-chat-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0084FF 0%, #0066cc 100%);
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
}

.cas-wb-chat-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 132, 255, 0.5);
    color: #fff;
}

.cas-wb-chat-cta svg {
    width: 26px;
    height: 26px;
}

.cas-wb-chat-cta-text {
    display: none;
}

/* GTranslate widget positioning — bottom left */
.cas-wb-gtranslate {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99;
}

/* Desktop (>768px)
   --------------------------------------------------------- */
@media (min-width: 768px) {
    .cas-wb-container {
        max-width: 720px;
    }

    .cas-wb-hero[style*="background-image"] {
        height: 300px;
    }

    .cas-wb-hero {
        border-radius: 0 0 var(--cas-wb-radius) var(--cas-wb-radius);
    }

    .cas-wb-title {
        font-size: 32px;
    }

    .cas-wb-section-title {
        font-size: 19px;
    }
}

/* Small mobile — stack widgets */
@media (max-width: 380px) {
    .cas-wb-widgets {
        grid-template-columns: 1fr;
    }
}

/* Print */
@media print {
    .cas-wb-chat-cta,
    .cas-wb-gtranslate,
    .cas-wb-widgets,
    .cas-wb-nav { display: none !important; }
    .cas-wb-section-header[aria-expanded="false"] + .cas-wb-section-body { display: flex !important; }
    .cas-wb-container { max-width: 100%; padding: 0; }
}
