/**
 * Sea Access Weather Widget Styles
 *
 * Design reference: seatrac.gr beach detail pages
 * Color palette aligned with sea-access.gr / Houzez theme
 *
 * @package Sea_Access_Weather
 * @version 1.0.0
 */

/* ────────────────────────────────────────────
   Base / Reset
   ──────────────────────────────────────────── */

.saw-widget {
    --saw-primary: #1a4e7a;
    --saw-primary-light: #2a6cb0;
    --saw-text: #333;
    --saw-text-muted: #6b7280;
    --saw-bg: transparent;
    --saw-border: #e5e7eb;
    --saw-temp-size: 2.25rem;
    --saw-label-size: 0.85rem;
    --saw-detail-size: 0.8rem;

    font-family: inherit;
    line-height: 1.4;
    color: var(--saw-text);
    box-sizing: border-box;
}

.saw-widget *,
.saw-widget *::before,
.saw-widget *::after {
    box-sizing: inherit;
}

/* ────────────────────────────────────────────
   Full Widget (Property Detail Page)
   ──────────────────────────────────────────── */

.saw-widget--full {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--saw-bg);
    text-align: center;
    min-width: 120px;
}

/* Header: "Σήμερα" label */
.saw-widget__header {
    width: 100%;
    text-align: center;
}

.saw-widget__label {
    display: block;
    font-size: var(--saw-label-size);
    font-weight: 600;
    color: var(--saw-primary);
    text-transform: none;
    letter-spacing: 0.02em;
}

/* Main: Icon + Temperature */
.saw-widget__main {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.saw-widget__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.saw-widget__icon svg {
    width: 48px;
    height: 48px;
    display: block;
}

.saw-widget__temp {
    display: flex;
    align-items: flex-start;
    line-height: 1;
}

.saw-widget__temp-value {
    font-size: var(--saw-temp-size);
    font-weight: 700;
    color: var(--saw-primary);
    letter-spacing: -0.02em;
}

.saw-widget__temp-unit {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--saw-primary-light);
    margin-top: 2px;
    margin-left: 1px;
}

/* Description */
.saw-widget__description {
    font-size: 0.8rem;
    color: var(--saw-text-muted);
    text-transform: capitalize;
    margin-top: 2px;
}

/* Details row: wind, humidity, etc. */
.saw-widget__details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--saw-border);
    width: 100%;
}

.saw-widget__detail {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--saw-detail-size);
    color: var(--saw-text-muted);
    white-space: nowrap;
}

.saw-widget__detail-icon {
    display: flex;
    align-items: center;
    color: var(--saw-primary-light);
    opacity: 0.7;
}

.saw-widget__detail-icon svg {
    width: 14px;
    height: 14px;
}

/* Stale notice */
.saw-widget__stale-notice {
    font-size: 0.7rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 4px;
}

.saw-widget--stale .saw-widget__icon {
    opacity: 0.65;
}

/* ────────────────────────────────────────────
   Layout: Horizontal
   ──────────────────────────────────────────── */

.saw-layout--horizontal {
    flex-direction: column;
    align-items: center;
}

/* ────────────────────────────────────────────
   Layout: Vertical (sidebar-friendly)
   ──────────────────────────────────────────── */

.saw-layout--vertical {
    flex-direction: column;
    align-items: center;
}

.saw-layout--vertical .saw-widget__details {
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* ────────────────────────────────────────────
   Compact Widget (Map Popup)
   ──────────────────────────────────────────── */

.saw-widget--compact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 0;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.saw-widget--compact .saw-widget__icon--sm {
    display: flex;
    align-items: center;
}

.saw-widget--compact .saw-widget__icon--sm svg {
    width: 28px;
    height: 28px;
}

.saw-widget--compact .saw-widget__temp-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--saw-primary);
    letter-spacing: -0.02em;
}

/* ────────────────────────────────────────────
   Map popup specific overrides
   ──────────────────────────────────────────── */

/* Inside Houzez map info window */
.map-info-card .saw-widget--compact,
.gm-style-iw .saw-widget--compact,
.leaflet-popup-content .saw-widget--compact {
    margin-top: 4px;
    padding: 2px 6px;
    background: rgba(26, 78, 122, 0.08);
    border-radius: 3px;
}

/* ────────────────────────────────────────────
   Elementor editor preview
   ──────────────────────────────────────────── */

.saw-widget--preview {
    border: 1px dashed #ddd;
    border-radius: 6px;
    background: #fafbfc;
}

/* ────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────── */

@media (max-width: 767px) {
    .saw-widget--full {
        padding: 10px 12px;
    }

    .saw-widget__icon svg {
        width: 40px;
        height: 40px;
    }

    .saw-widget__temp-value {
        font-size: 1.75rem;
    }

    .saw-widget__details {
        gap: 8px;
    }
}

/* ────────────────────────────────────────────
   Print
   ──────────────────────────────────────────── */

@media print {
    .saw-widget {
        border: 1px solid #ccc;
        padding: 8px;
    }

    .saw-widget__icon svg {
        width: 24px;
        height: 24px;
    }
}

/* ────────────────────────────────────────────
   Accessibility: Reduced motion
   ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .saw-widget,
    .saw-widget * {
        animation: none !important;
        transition: none !important;
    }
}

/* ────────────────────────────────────────────
   Dark mode support (if theme provides)
   ──────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    .saw-widget {
        --saw-text: #e5e7eb;
        --saw-text-muted: #9ca3af;
        --saw-border: #374151;
    }

    .saw-widget--compact {
        background: rgba(30, 41, 59, 0.9);
    }
}
