/* ══════════════════════════════════════════════════════════════════
   SMART HOME MODULE — Radim Branding v1.0
   Barvy: teal #5BA8A0, coral #F07D7E, bg #f8fafa
   ══════════════════════════════════════════════════════════════════ */

.sh-module {
    padding: 12px;
    max-width: 900px;
    margin: 0 auto;
    color: #2d3748;
}

/* ─── TABS ─── */
.sh-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: #f0f4f5;
    border-radius: 14px;
    padding: 4px;
}

.sh-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #718096;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sh-tab.active {
    background: #ffffff;
    color: #5BA8A0;
    box-shadow: 0 2px 8px rgba(91, 168, 160, 0.15);
}

.sh-tab-icon { font-size: 1.1rem; }

/* ─── STATUS BAR ─── */
.sh-status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #718096;
    border: 1px solid #e2e8f0;
}

.sh-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    display: inline-block;
}

.sh-status-dot.connected {
    background: #48bb78;
    box-shadow: 0 0 6px rgba(72, 187, 120, 0.4);
}

/* ─── ROOMS GRID ─── */
.sh-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.sh-room-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.sh-room-card:hover {
    border-color: #5BA8A0;
    box-shadow: 0 4px 16px rgba(91, 168, 160, 0.15);
    transform: translateY(-2px);
}

.sh-room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sh-room-name {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
}

.sh-room-count {
    font-size: 0.75rem;
    color: #a0aec0;
    background: #f7fafc;
    padding: 2px 8px;
    border-radius: 10px;
}

.sh-room-info {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.sh-room-stat {
    font-size: 0.85rem;
    color: #718096;
}

.sh-room-stat.active {
    color: #5BA8A0;
    font-weight: 600;
}

.sh-room-devices {
    display: flex;
    gap: 6px;
}

.sh-device-mini {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f7fafc;
    font-size: 1.1rem;
    border: 1px solid #e2e8f0;
    -webkit-tap-highlight-color: transparent;
}

.sh-device-mini.active {
    background: #e6fffa;
    border-color: #5BA8A0;
}

/* ─── DEVICE LIST ─── */
.sh-device-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sh-device-card {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    gap: 14px;
}

.sh-device-card.active {
    border-color: #5BA8A0;
    background: #f0fdfa;
}

.sh-device-card.locked {
    border-color: #ed8936;
}

.sh-device-icon {
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 12px;
}

.sh-device-info {
    flex: 1;
}

.sh-device-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
}

.sh-device-state {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 2px;
}

/* ─── TOGGLE BUTTON ─── */
.sh-toggle-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sh-toggle-btn:hover {
    border-color: #5BA8A0;
}

.sh-toggle-btn.on {
    background: #5BA8A0;
    border-color: #5BA8A0;
    color: white;
}

.sh-toggle-btn.locked {
    background: #ed8936;
    border-color: #ed8936;
    color: white;
}

/* ─── CLIMATE CONTROLS ─── */
.sh-climate-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sh-temp-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5BA8A0;
    font-weight: 700;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.sh-temp-btn:hover { background: #f0fdfa; border-color: #5BA8A0; }
.sh-temp-btn:active { transform: scale(0.93); }

.sh-temp-val {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
    min-width: 36px;
    text-align: center;
}

/* ─── SENSORS ─── */
.sh-sensors-grid { display: flex; flex-direction: column; gap: 20px; }

.sh-sensor-section h4 {
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.sh-sensor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.sh-sensor-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.sh-sensor-card.active {
    border-color: #48bb78;
    background: #f0fff4;
}

.sh-sensor-card.alert {
    border-color: #fc8181;
    background: #fff5f5;
}

.sh-sensor-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
}

.sh-sensor-name {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
}

/* ─── BACK BUTTON ─── */
.sh-back-btn {
    background: none;
    border: none;
    color: #5BA8A0;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.sh-room-title {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 16px;
}

/* ─── EMPTY STATE ─── */
.sh-empty {
    text-align: center;
    padding: 40px 20px;
}

.sh-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.sh-empty h3 { color: #2d3748; margin-bottom: 8px; }
.sh-empty p { color: #a0aec0; font-size: 0.9rem; }

/* ─── TOAST ─── */
.sh-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    transition: opacity 0.3s;
}

.sh-toast.success { background: #f0fff4; color: #22543d; border: 1px solid #48bb78; }
.sh-toast.error { background: #fff5f5; color: #742a2a; border: 1px solid #fc8181; }
.sh-toast.hidden { opacity: 0; pointer-events: none; }

/* ─── LOADING ─── */
.sh-loading {
    text-align: center;
    padding: 40px;
}

.sh-loading p { color: #718096; margin-top: 12px; }

.sh-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(91, 168, 160, 0.2);
    border-top: 3px solid #5BA8A0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .sh-rooms-grid { grid-template-columns: 1fr; }
    .sh-sensor-cards { grid-template-columns: repeat(2, 1fr); }
    .sh-tab { font-size: 0.85rem; padding: 8px 10px; }
    .sh-device-card { padding: 12px 14px; }
}
