/**
 * Calandus Weather Widget v2.0.0
 * Self-contained styles - works on any background
 * Themes: dark, light, transparent
 * 
 * UPDATED: Larger icons and text for better visibility
 */

.calandus-weather-widget { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.4; box-sizing: border-box; }
.calandus-weather-widget *, .calandus-weather-widget *::before, .calandus-weather-widget *::after { box-sizing: inherit; }

/* Loading */
.calandus-weather-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 30px; color: rgba(255,255,255,0.7); }
.calandus-loading-spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.2); border-top-color: #3b82f6; border-radius: 50%; animation: calandus-spin 0.8s linear infinite; }
@keyframes calandus-spin { to { transform: rotate(360deg); } }

/* Error / No location */
.calandus-weather-error { padding: 20px; text-align: center; color: #ff6b6b; background: rgba(255,107,107,0.1); border-radius: 8px; font-size: 16px; }
.calandus-weather-no-location { padding: 20px; text-align: center; color: rgba(255,255,255,0.6); font-size: 16px; }

/* Main Layout - Horizontal */
.calandus-weather-main { display: flex; align-items: center; gap: 30px; padding: 20px; width: 100%; }

/* LEFT: Location + Current */
.calandus-weather-left { display: flex; flex-direction: column; align-items: flex-start; flex-shrink: 0; min-width: 180px; }
.calandus-weather-location { font-size: 20px; font-weight: 500; color: rgba(255,255,255,0.85); margin-bottom: 10px; max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calandus-weather-current { display: flex; align-items: center; gap: 12px; }
.calandus-weather-icon { width: 130px; height: 130px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.calandus-weather-icon svg { width: 100%; height: 100%; display: block; }
.calandus-weather-temp { font-size: 80px; font-weight: 600; color: #fff; line-height: 1; }

/* RIGHT: Details + Forecast */
.calandus-weather-right { display: flex; align-items: center; gap: 24px; flex: 1; justify-content: flex-start; }

/* Details */
.calandus-weather-details { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.calandus-detail-item { display: flex; align-items: center; gap: 8px; font-size: 18px; color: rgba(255,255,255,0.85); }
.calandus-detail-icon { font-size: 20px; width: 26px; text-align: center; }

/* Wind Arrow */
.calandus-wind-arrow { display: inline-flex; align-items: center; justify-content: center; color: #60a5fa; }
.calandus-wind-arrow .wind-arrow-svg { display: block; width: 22px; height: 22px; }
.calandus-wind-gust { color: #ef4444; font-weight: 600; font-size: 14px; }

/* Forecast */
.calandus-weather-forecast { display: flex; gap: 0; overflow-x: auto; padding: 6px 0; }
.calandus-forecast-hour { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 6px; min-width: 70px; background: transparent; border-radius: 8px; transition: background 0.2s; }
.calandus-forecast-hour:hover { background: rgba(255,255,255,0.1); }
.calandus-forecast-time { font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.7); margin-bottom: 4px; }
.calandus-forecast-icon { width: 60px; height: 60px; line-height: 1; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; }
.calandus-forecast-icon svg { width: 100%; height: 100%; display: block; }
.calandus-forecast-precip { font-size: 13px; color: #60a5fa; font-weight: 500; min-height: 18px; margin-bottom: 4px; }
.calandus-forecast-temp { font-size: 24px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.calandus-forecast-wind { display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 13px; color: rgba(255,255,255,0.7); min-height: 20px; }
.calandus-forecast-wind .calandus-wind-arrow { color: #60a5fa; }
.calandus-forecast-wind .wind-arrow-svg { width: 18px; height: 18px; }
.calandus-forecast-wind .calandus-wind-speed { font-size: 13px; font-weight: 500; }
.calandus-forecast-wind .calandus-wind-gust { font-size: 11px; }

/* THEME: Dark (default) */
.calandus-weather-widget.theme-dark { background: rgba(30,30,30,0.9); border-radius: 12px; color: #fff; }

/* THEME: Light */
.calandus-weather-widget.theme-light { background: rgba(255,255,255,0.95); border-radius: 12px; color: #1f2937; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.calandus-weather-widget.theme-light .calandus-weather-location { color: #4b5563; }
.calandus-weather-widget.theme-light .calandus-weather-temp { color: #1f2937; }
.calandus-weather-widget.theme-light .calandus-detail-item { color: #374151; }
.calandus-weather-widget.theme-light .calandus-forecast-time { color: #6b7280; }
.calandus-weather-widget.theme-light .calandus-forecast-temp { color: #1f2937; }
.calandus-weather-widget.theme-light .calandus-forecast-wind { color: #6b7280; }
.calandus-weather-widget.theme-light .calandus-forecast-hour:hover { background: rgba(0,0,0,0.05); }
.calandus-weather-widget.theme-light .calandus-weather-loading { color: #6b7280; }
.calandus-weather-widget.theme-light .calandus-loading-spinner { border-color: rgba(0,0,0,0.1); border-top-color: #3b82f6; }

/* THEME: Transparent */
.calandus-weather-widget.theme-transparent { background: transparent; color: #fff; }
.calandus-weather-widget.theme-transparent .calandus-weather-location { color: rgba(255,255,255,0.9); }
.calandus-weather-widget.theme-transparent .calandus-detail-item { color: rgba(255,255,255,0.9); }
.calandus-weather-widget.theme-transparent .calandus-forecast-time { color: rgba(255,255,255,0.75); }
.calandus-weather-widget.theme-transparent .calandus-forecast-wind { color: rgba(255,255,255,0.8); }
.calandus-weather-widget.theme-transparent .calandus-wind-arrow { color: #66b3ff; }
.calandus-weather-widget.theme-transparent .calandus-forecast-precip { color: #66b3ff; }
.calandus-weather-widget.theme-transparent .calandus-wind-gust { color: #ff6b6b; }

/* Settings Form */
.calandus-weather-settings-container { padding: 16px; background: #f8fafc; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); max-width: 100%; }
.calandus-weather-settings-form h3 { margin: 0 0 16px; font-size: 18px; font-weight: 600; color: #1e293b; }
.calandus-current-location-info { background: #fff; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.calandus-current-location-info p { margin: 0; color: #334155; font-size: 14px; }
.calandus-location-coords { margin-top: 4px !important; color: #64748b !important; }
.calandus-weather-location-search { margin-bottom: 20px; position: relative; }
.calandus-weather-location-search label { display: block; margin-bottom: 6px; font-weight: 500; color: #334155; font-size: 14px; }
.calandus-weather-search-input { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; box-sizing: border-box; }
.calandus-weather-search-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.calandus-weather-search-results { position: absolute; width: 100%; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; display: none; }
.calandus-search-result-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
.calandus-search-result-item:hover { background: #f1f5f9; }
.calandus-result-name { font-weight: 500; color: #1e293b; margin-bottom: 2px; }
.calandus-result-coords { font-size: 12px; color: #64748b; }
.calandus-no-results { padding: 16px; text-align: center; color: #64748b; font-size: 14px; }
.calandus-weather-manual-input { margin-bottom: 20px; }
.calandus-manual-label { font-size: 13px; color: #64748b; margin-bottom: 12px; }
.calandus-form-field { margin-bottom: 12px; }
.calandus-form-field label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 500; color: #334155; }
.calandus-form-field input { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; box-sizing: border-box; }
.calandus-form-field input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.calandus-coords-row { display: flex; gap: 12px; }
.calandus-coords-row .calandus-form-field { flex: 1; min-width: 0; }
.calandus-save-weather-location { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 40px; padding: 0 20px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer; transition: background 0.2s ease; box-sizing: border-box; }
.calandus-save-weather-location:hover { background: #1d4ed8; }
.calandus-save-weather-location:disabled { background: #94a3b8; cursor: not-allowed; }
.calandus-weather-login-required { padding: 20px; text-align: center; color: #64748b; background: #f8fafc; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
    .calandus-weather-main { flex-direction: column; align-items: flex-start; gap: 20px; }
    .calandus-weather-right { flex-direction: column; align-items: flex-start; width: 100%; }
    .calandus-weather-details { flex-direction: row; gap: 20px; }
    .calandus-weather-forecast { width: 100%; }
}

/* ========================================
   COMPACT LAYOUT - for dashboard cards
   ======================================== */
.calandus-weather-widget.layout-compact { background: transparent; }

.calandus-weather-compact { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    padding: 10px 0;
}

.calandus-compact-current { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    margin-bottom: 15px;
}

.calandus-compact-location { 
    font-size: 14px; 
    color: rgba(255,255,255,0.7); 
    margin-bottom: 10px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calandus-compact-main { 
    display: flex; 
    align-items: center; 
    gap: 10px;
}

.calandus-compact-icon { 
    width: 60px; 
    height: 60px;
}

.calandus-compact-icon svg { 
    width: 100%; 
    height: 100%; 
}

.calandus-compact-temp { 
    font-size: 48px; 
    font-weight: 200; 
    color: #fff;
}

.calandus-compact-details { 
    display: flex; 
    gap: 15px; 
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.calandus-compact-detail { 
    display: flex; 
    align-items: center; 
    gap: 4px;
}

.calandus-compact-detail .wind-arrow-svg {
    width: 14px;
    height: 14px;
}

/* Compact Forecast */
.calandus-compact-forecast { 
    display: flex; 
    justify-content: center; 
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
}

.calandus-compact-forecast-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    gap: 4px;
}

.calandus-compact-forecast-label { 
    font-size: 11px; 
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

.calandus-compact-forecast-icon { 
    width: 32px; 
    height: 32px;
}

.calandus-compact-forecast-icon svg { 
    width: 100%; 
    height: 100%; 
}

.calandus-compact-forecast-temp { 
    font-size: 16px; 
    font-weight: 500; 
    color: #fff;
}

/* Theme adjustments for compact */
.calandus-weather-widget.theme-light.layout-compact .calandus-compact-location { color: #6b7280; }
.calandus-weather-widget.theme-light.layout-compact .calandus-compact-temp { color: #1f2937; }
.calandus-weather-widget.theme-light.layout-compact .calandus-compact-details { color: #6b7280; }
.calandus-weather-widget.theme-light.layout-compact .calandus-compact-forecast { border-top-color: rgba(0,0,0,0.1); }
.calandus-weather-widget.theme-light.layout-compact .calandus-compact-forecast-label { color: #9ca3af; }
.calandus-weather-widget.theme-light.layout-compact .calandus-compact-forecast-temp { color: #1f2937; }

/* Scrollbar */
.calandus-weather-forecast::-webkit-scrollbar { height: 6px; }
.calandus-weather-forecast::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 3px; }
.calandus-weather-forecast::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }
