/* ============================================
   Homesteading Guides Stylesheet
   Shared CSS classes for Gardening, Fruit Trees, Landscaping guides
   Uses hs- prefix (homesteading)
   ============================================ */

/* --- Info Boxes / Callouts --- */

.guide-info-box-hs {
    background-color: rgba(76, 175, 80, 0.1);
    padding: 12px;
    border-left: 3px solid #4caf50;
    margin: 15px 0;
}
.guide-info-box-hs p:first-child {
    margin: 0;
    font-size: 0.9em;
}
.guide-warning-box-hs {
    background-color: rgba(255, 165, 0, 0.1);
    padding: 12px;
    border-left: 3px solid #ffa500;
    margin: 15px 0;
}
.guide-warning-box-hs p:first-child {
    margin: 0;
    font-size: 0.9em;
}
.guide-success-box-hs {
    background-color: rgba(0, 255, 65, 0.1);
    padding: 12px;
    border-left: 3px solid #00ff41;
    margin: 15px 0;
}
.guide-danger-box-hs {
    background-color: rgba(255, 68, 68, 0.1);
    padding: 12px;
    border-left: 3px solid #ff4444;
    margin: 15px 0;
}

/* --- Structured Sections (collapsible) --- */

.hs-description { font-size: 0.92rem; opacity: 0.85; margin: 4px 0 8px; line-height: 1.5; }

.hs-section {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 7px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.hs-section.expanded { border-color: rgba(76, 175, 80, 0.4); }

.hs-section-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; cursor: pointer; user-select: none;
    transition: background 0.15s;
}
[data-md-color-scheme="slate"] .hs-section-header { background: rgba(255,255,255,0.04); }
[data-md-color-scheme="light"] .hs-section-header,
[data-md-color-scheme="default"] .hs-section-header { background: rgba(0,0,0,0.03); }
.hs-section-header:hover { background: rgba(76, 175, 80, 0.12); }

.hs-arrow { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }
.hs-section-title { font-weight: 600; font-size: 1rem; }

.hs-section-body { padding: 14px 18px 18px; line-height: 1.65; }
.hs-section-body h5 { margin-top: 18px; margin-bottom: 6px; font-size: 0.95rem; color: #4caf50; }
.hs-section-body pre { margin: 8px 0 14px; border-radius: 5px; overflow-x: auto; }
.hs-section-body code {
    display: block; white-space: pre;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem; padding: 12px 14px;
    border-radius: 5px; line-height: 1.55;
}
[data-md-color-scheme="slate"] .hs-section-body code { background: #141e27; color: #c9d8e6; }
[data-md-color-scheme="light"] .hs-section-body code,
[data-md-color-scheme="default"] .hs-section-body code { background: #eef1f5; color: #1e2a35; }
.hs-section-body ul { padding-left: 20px; line-height: 1.8; }
.hs-section-body li { margin-bottom: 4px; }

/* --- Tables --- */
.hs-section-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.9rem;
}
.hs-section-body th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hs-section-body td {
    padding: 8px 12px;
    vertical-align: top;
}
[data-md-color-scheme="slate"] .hs-section-body th { background: rgba(76,175,80,0.15); color: #81c784; border-bottom: 2px solid rgba(76,175,80,0.3); }
[data-md-color-scheme="slate"] .hs-section-body td { border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-md-color-scheme="light"] .hs-section-body th,
[data-md-color-scheme="default"] .hs-section-body th { background: rgba(76,175,80,0.1); color: #2e7d32; border-bottom: 2px solid rgba(76,175,80,0.25); }
[data-md-color-scheme="light"] .hs-section-body td,
[data-md-color-scheme="default"] .hs-section-body td { border-bottom: 1px solid rgba(0,0,0,0.06); }

.hs-section-body tr:hover td {
    background: rgba(76,175,80,0.05);
}

/* --- Badges / Tags --- */
.hs-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 1px 2px;
}
.hs-badge-health { background: rgba(76,175,80,0.2); color: #4caf50; }
.hs-badge-season { background: rgba(33,150,243,0.2); color: #42a5f5; }
.hs-badge-warning { background: rgba(255,152,0,0.2); color: #ffa726; }
.hs-badge-tip { background: rgba(156,39,176,0.2); color: #ba68c8; }

/* --- Scale Reference Button & Floating Panel --- */
.btn-scale-ref {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border: none; border-radius: 6px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    background: linear-gradient(135deg, #26a69a, #43a047);
    color: #fff; transition: opacity 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.btn-scale-ref:hover { opacity: 0.88; box-shadow: 0 2px 8px rgba(38,166,154,0.3); }

.hs-sr-panel {
    position: fixed; z-index: 10002;
    width: 440px; max-height: 70vh;
    border-radius: 10px; overflow: hidden;
    display: flex; flex-direction: column;
    opacity: 0; transform: translateY(-8px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}
.hs-sr-panel.hs-sr-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
[data-md-color-scheme="slate"] .hs-sr-panel {
    background: #1e1e1e; border: 1px solid rgba(76,175,80,0.35);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
[data-md-color-scheme="light"] .hs-sr-panel,
[data-md-color-scheme="default"] .hs-sr-panel {
    background: #fff; border: 1px solid rgba(76,175,80,0.35);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.hs-sr-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid rgba(76,175,80,0.2);
}
.hs-sr-title { font-weight: 700; font-size: 0.92rem; }
[data-md-color-scheme="slate"] .hs-sr-title { color: #81c784; }
[data-md-color-scheme="light"] .hs-sr-title,
[data-md-color-scheme="default"] .hs-sr-title { color: #2e7d32; }
.hs-sr-close {
    font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 2px 6px;
    border-radius: 4px; transition: background 0.15s;
}
.hs-sr-close:hover { background: rgba(255,255,255,0.1); }
.hs-sr-body { padding: 10px 14px; overflow-y: auto; font-size: 0.85rem; }
@media (max-width: 560px) { .hs-sr-panel { width: calc(100vw - 24px); left: 12px !important; } }

/* --- Scale Bars (Water / Sunlight 1–10) --- */
.hs-scale {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.hs-scale-bar {
    display: inline-block;
    width: 7px; height: 14px;
    border-radius: 2px;
    opacity: 0.25;
}
.hs-scale-bar.filled { opacity: 1; }
.hs-scale-water .hs-scale-bar { background: #42a5f5; }
.hs-scale-sun .hs-scale-bar { background: #ffa726; }
.hs-scale-label {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 4px;
    font-style: italic;
}
[data-md-color-scheme="light"] .hs-scale-water .hs-scale-bar { background: #1e88e5; }
[data-md-color-scheme="light"] .hs-scale-sun .hs-scale-bar { background: #f57c00; }

/* Scale legend box */
.hs-scale-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 10px 0 14px;
    font-size: 0.82rem;
    line-height: 1.6;
}
[data-md-color-scheme="slate"] .hs-scale-legend { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
[data-md-color-scheme="light"] .hs-scale-legend,
[data-md-color-scheme="default"] .hs-scale-legend { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.08); }
.hs-scale-legend-item { display: flex; align-items: center; gap: 6px; }

/* Dark mode */
[data-md-color-scheme="slate"] .hs-arrow { color: #4caf50; }
[data-md-color-scheme="slate"] .hs-section-body h5 { color: #81c784; }

/* Light mode */
[data-md-color-scheme="light"] .hs-arrow,
[data-md-color-scheme="default"] .hs-arrow { color: #2e7d32; }
[data-md-color-scheme="light"] .hs-section-body h5,
[data-md-color-scheme="default"] .hs-section-body h5 { color: #2e7d32; }

/* Responsive */
@media (max-width: 768px) {
    .hs-section-header { padding: 10px 12px; }
    .hs-section-body   { padding: 10px 12px 14px; }
    .hs-section-body table { font-size: 0.82rem; }
    .hs-section-body th, .hs-section-body td { padding: 6px 8px; }
}
