/* ═══════════════════════════════════════════════════════════════════════
   Sun, Moon, and Fishing Calendar Pro — v5.0
   Extracted CSS for browser caching & performance
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════ SEO: SSR toggle ═══════════════ */
#smfc-ssr { display: block; }
#smfc-header,
#calendar-settings-panel,
#smfc-daily-summary { display: none; }

.smfc-js-loaded #smfc-ssr { display: none !important; }
.smfc-js-loaded #smfc-header { display: flex !important; }
.smfc-js-loaded #calendar-settings-panel { display: block !important; }
.smfc-js-loaded #smfc-daily-summary { display: block !important; }

/* ═══════════════ Header ═══════════════ */
#smfc-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    text-align: center;
}
#smfc-logo {
    max-height: 56px;
    width: auto;
    display: block;
}
#smfc-main-title {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
    color: #111;
}
@media (min-width: 560px) {
    #smfc-header {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
        text-align: left;
    }
}

/* ═══════════════ Settings panel ═══════════════ */
.smfc-settings {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a3f 100%);
    border-radius: 14px;
    padding: 18px 18px 16px;
    margin-bottom: 16px;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.smfc-settings-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 14px;
    text-align: center;
}
.smfc-settings-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    margin-bottom: 8px !important;
    align-items: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-wrap: wrap !important;
}
.smfc-settings-col {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    box-sizing: border-box !important;
}
@media (max-width: 700px) {
    .smfc-settings-grid {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .smfc-settings-col {
        max-width: 100% !important;
        width: 100% !important;
    }
}
.smfc-label {
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: #fff;
}
.smfc-loc-wrap {
    position: relative;
    width: 100%;
}
.smfc-loc-input {
    width: 100% !important;
    max-width: 100% !important;
    padding: 9px 10px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    font-size: 0.9em;
    font-weight: 500;
    box-sizing: border-box !important;
    display: block !important;
    min-height: 40px;
    line-height: 1.4;
    margin: 0 !important;
}
.smfc-loc-input::placeholder { color: rgba(255, 255, 255, 0.55); }
.smfc-loc-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(255, 255, 255, 0.2) !important;
}
.smfc-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-radius: 6px;
    margin-top: 4px;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.smfc-search-results.active { display: block; }
.smfc-result-item {
    padding: 9px 10px;
    color: #111;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 0.85em;
    background: #fff;
}
.smfc-result-item:hover { background: #f3f4f6; }
.smfc-result-item:last-child { border-bottom: none; }
.smfc-cur-loc {
    font-size: 0.78em;
    opacity: 0.85;
    margin: 6px 0 10px;
    text-align: center;
    color: #fff;
}

/* ── Geolocation button ── */
.smfc-geo-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 0.82em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    margin-top: 4px;
    font-weight: 500;
}
.smfc-geo-btn:hover { background: rgba(255, 255, 255, 0.25); }
.smfc-geo-btn.loading { opacity: 0.6; pointer-events: none; }

/* ── Language dropdown ── */
.smfc-lang-wrap { position: relative; width: 100%; }
.smfc-lang-btn {
    width: 100%;
    max-width: 100%;
    padding: 9px 32px 9px 10px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
    min-height: 40px;
}
.smfc-lang-btn:hover { background: rgba(255, 255, 255, 0.2); }
.smfc-lang-btn .smfc-lang-arrow {
    font-size: 0.75em;
    opacity: 0.8;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.smfc-lang-wrap.open .smfc-lang-arrow { transform: rotate(180deg); }
.smfc-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 99999;
    background: #1a3352;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
}
.smfc-lang-wrap.open .smfc-lang-dropdown { display: block; }
.smfc-lang-option {
    padding: 11px 14px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.smfc-lang-option:last-child { border-bottom: none; }
.smfc-lang-option:hover { background: rgba(255, 255, 255, 0.14); }
.smfc-lang-option.active { background: rgba(255, 255, 255, 0.2); font-weight: 700; }

/* ── Apply button ── */
.smfc-apply-btn {
    width: 100%;
    padding: 11px;
    background: #fff;
    color: #1e3a5f;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s, transform 0.15s;
}
.smfc-apply-btn:hover { background: #f0f0f0; transform: translateY(-1px); }
.smfc-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #fff;
    animation: smfc-spin 0.6s linear infinite;
}
@keyframes smfc-spin { to { transform: rotate(360deg); } }

/* ═══════════════ Month navigator ═══════════════ */
.smfc-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
}
.smfc-month-nav-btn {
    flex-shrink: 0;
    padding: 9px 14px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    min-height: 44px;
    transition: background 0.2s;
    white-space: nowrap;
}
.smfc-month-nav-btn:hover { background: #15304f; }
.smfc-month-nav-label {
    flex: 1;
    font-size: 1.05em;
    font-weight: 700;
    color: #111;
    text-align: center;
    min-width: 0;
}

/* ═══════════════ View toggle (Strip / Grid) ═══════════════ */
.smfc-view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    justify-content: center;
}
.smfc-view-btn {
    padding: 6px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 36px;
}
.smfc-view-btn:hover { background: #f3f4f6; }
.smfc-view-btn.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

/* ═══════════════ Strip ═══════════════ */
#smfc-daily-summary { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.smfc-strip-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}
.smfc-strip-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    color: #374151;
    transition: background 0.15s;
    user-select: none;
}
.smfc-strip-arrow:hover { background: #f3f4f6; }
.smfc-strip-inner {
    flex: 1;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.smfc-strip-inner::-webkit-scrollbar { display: none; }
.smfc-strip-day {
    flex-shrink: 0;
    scroll-snap-align: center;
    min-width: 70px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 7px 5px 6px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    position: relative;
}
.smfc-strip-day:hover { border-color: #93c5fd; }
.smfc-strip-day.today {
    border: 3px solid #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
    background: #fff5f5;
}
.smfc-strip-day.today .smfc-strip-dow { color: #dc2626; font-weight: 700; }
.smfc-strip-day.active:not(.today) { border-color: #1e3a5f; box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12); }
.smfc-strip-day.weekend:not(.holiday):not(.today) { background: #f0f5ff; border-color: #bfdbfe; }
.smfc-strip-day.holiday:not(.today) { background: #fffbeb; border-color: #fbbf24; }
.smfc-strip-day.holiday.active:not(.today) { border-color: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18); }
.smfc-strip-num { font-size: 1.45em; font-weight: 700; color: #111; line-height: 1; }
.smfc-strip-mon { font-size: 0.68em; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; margin: 2px 0; }
.smfc-strip-dow { font-size: 0.66em; font-weight: 600; color: #6b7280; text-transform: uppercase; }
.smfc-strip-day.active:not(.today) .smfc-strip-dow { color: #1e3a5f; }
.smfc-strip-icons { font-size: 0.82em; margin-top: 4px; line-height: 1; }
.smfc-strip-hol-name {
    font-size: 0.58em;
    color: #92400e;
    font-weight: 600;
    margin-top: 3px;
    line-height: 1.2;
    word-break: break-word;
}

/* ═══════════════ GRID VIEW ═══════════════ */
.smfc-grid-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}
.smfc-grid-header {
    font-size: 0.72em;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    text-align: center;
    padding: 6px 2px;
    letter-spacing: 0.05em;
}
.smfc-grid-empty { background: transparent; }
.smfc-grid-cell {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px 3px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}
.smfc-grid-cell:hover { border-color: #93c5fd; }
.smfc-grid-cell.today { border: 2.5px solid #dc2626 !important; background: #fff5f5; }
.smfc-grid-cell.active:not(.today) { border-color: #1e3a5f; box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12); }
.smfc-grid-cell.weekend:not(.holiday):not(.today) { background: #f8faff; border-color: #dbeafe; }
.smfc-grid-cell.holiday:not(.today) { background: #fffbeb; border-color: #fbbf24; }
.smfc-grid-cell-num { font-size: 1.1em; font-weight: 700; color: #111; line-height: 1; }
.smfc-grid-cell-fish { font-size: 0.72em; line-height: 1; margin-top: 2px; }
.smfc-grid-cell-moon { font-size: 0.72em; line-height: 1; }
.smfc-grid-cell-score {
    font-size: 0.6em;
    font-weight: 700;
    line-height: 1;
    margin-top: 1px;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
}
.smfc-grid-cell-score.s-high { background: #dcfce7; color: #166534; }
.smfc-grid-cell-score.s-mid { background: #fef9c3; color: #854d0e; }
.smfc-grid-cell-score.s-low { background: #fee2e2; color: #991b1b; }
.smfc-grid-cell-hol { font-size: 0.5em; color: #d97706; font-weight: 700; line-height: 1; }

@media (max-width: 480px) {
    .smfc-grid-cell { min-height: 58px; padding: 3px 1px; }
    .smfc-grid-cell-num { font-size: 0.95em; }
}

/* ═══════════════ Monthly chart ═══════════════ */
.smfc-chart-wrap {
    margin-bottom: 18px;
    padding: 14px 10px 10px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}
.smfc-chart-title {
    font-size: 0.82em;
    font-weight: 700;
    color: #374151;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.smfc-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 80px;
    width: 100%;
    box-sizing: border-box;
}
.smfc-chart-bar {
    flex: 1;
    min-width: 0;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    transition: opacity 0.15s;
    position: relative;
}
.smfc-chart-bar:hover { opacity: 0.8; }
.smfc-chart-bar.bar-active { box-shadow: 0 0 0 2px #1e3a5f; }
.smfc-chart-bar-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 0.68em;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}
.smfc-chart-bar:hover .smfc-chart-bar-tip { display: block; }
.smfc-chart-labels {
    display: flex;
    gap: 2px;
    margin-top: 3px;
}
.smfc-chart-lbl {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 0.55em;
    color: #9ca3af;
    overflow: hidden;
}

/* ═══════════════ Detail cards ═══════════════ */
.smfc-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 520px) {
    .smfc-detail-grid { grid-template-columns: 1fr; }
}
.smfc-detail-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 16px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.smfc-score-label { font-size: 0.82em; font-weight: 600; color: #374151; text-align: center; margin-bottom: 4px; }
.smfc-score-num { font-size: 3.2em; font-weight: 700; color: #111; text-align: center; line-height: 1; margin: 4px 0 2px; }
.smfc-score-range { font-size: 0.75em; color: #9ca3af; text-align: center; margin-bottom: 12px; }
.smfc-activity-label { font-size: 0.82em; font-weight: 600; color: #374151; text-align: center; margin: 8px 0 6px; }
.smfc-fish-row { display: flex; justify-content: center; gap: 4px; font-size: 1.5em; }

/* ── Sun tiles ── */
.smfc-sun-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
}
.smfc-sun-tile {
    background: #f8faff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 6px 9px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.smfc-sun-tile-icon { font-size: 1.7em; line-height: 1; }
.smfc-sun-tile-label { font-size: 0.72em; color: #6b7280; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.smfc-sun-tile-val { font-size: 1.05em; font-weight: 700; color: #111; }
.smfc-daylen { text-align: center; font-size: 0.8em; color: #6b7280; margin-top: 8px; }

/* ═══════════════ Weather tiles ═══════════════ */
.smfc-weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
}
@media (max-width: 400px) {
    .smfc-weather-grid { grid-template-columns: 1fr; }
}
.smfc-weather-tile {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px 6px 9px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.smfc-weather-tile.pressure-tile { background: #eff6ff; border-color: #bfdbfe; }
.smfc-weather-tile-icon { font-size: 1.5em; line-height: 1; }
.smfc-weather-tile-label { font-size: 0.68em; color: #6b7280; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.smfc-weather-tile-val { font-size: 0.95em; font-weight: 700; color: #111; }
.smfc-weather-tile-sub { font-size: 0.65em; color: #6b7280; margin-top: 1px; }
.smfc-weather-loading {
    text-align: center;
    font-size: 0.78em;
    color: #9ca3af;
    padding: 12px 0;
    border-top: 1px solid #f3f4f6;
    margin-top: 14px;
}

/* ── Periods & Moon ── */
.smfc-period-block { margin-bottom: 16px; text-align: center; }
.smfc-period-block:last-child { margin-bottom: 0; }
.smfc-period-label { font-size: 0.78em; font-weight: 700; color: #374151; text-align: center; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.smfc-period-times { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.smfc-period-time { font-size: 0.95em; color: #111; text-align: center; font-weight: 600; }

.smfc-moon-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}
.smfc-moon-icon-big { font-size: 2.8em; line-height: 1; margin: 6px 0 4px; }
.smfc-moon-name-big { font-size: 0.88em; color: #374151; font-weight: 500; }
.smfc-moon-illum { font-size: 0.82em; color: #6b7280; margin-top: 3px; }
.smfc-moon-illum-bar {
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 5px auto 0;
    overflow: hidden;
}
.smfc-moon-illum-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #fde68a);
    border-radius: 3px;
    transition: width 0.3s;
}
.smfc-moon-dist { font-size: 0.82em; color: #6b7280; margin-top: 6px; }
.smfc-moon-dist-km { font-size: 0.78em; color: #9ca3af; margin-top: 2px; }

/* ── Best time ── */
.smfc-best-time-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}
.smfc-best-time-label { font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; margin-bottom: 4px; }
.smfc-best-time-val { font-size: 1.1em; font-weight: 700; color: #111; margin-bottom: 3px; }
.smfc-best-time-tip { font-size: 0.75em; color: #6b7280; line-height: 1.4; }

/* ═══════════════ Pressure trend indicator ═══════════════ */
.smfc-pressure-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.smfc-pressure-trend.rising { background: #dcfce7; color: #166534; }
.smfc-pressure-trend.stable { background: #dbeafe; color: #1e40af; }
.smfc-pressure-trend.falling { background: #fee2e2; color: #991b1b; }

/* ═══════════════ Responsive ═══════════════ */
@media (max-width: 480px) {
    .smfc-month-nav-btn { padding: 9px 10px; font-size: 0.78em; }
    .smfc-month-nav-btn .smfc-btn-long { display: none; }
    .smfc-month-nav-btn .smfc-btn-short { display: inline; }
    .smfc-strip-day { min-width: 62px; }
}
@media (min-width: 481px) {
    .smfc-month-nav-btn .smfc-btn-short { display: none; }
    .smfc-month-nav-btn .smfc-btn-long { display: inline; }
}
