/* ============================================
   ESP32 Sensor Dashboard - Styles
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(30, 30, 50, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --accent-blue: #4f8cff;
    --accent-green: #00d97e;
    --accent-orange: #ff9f43;
    --accent-red: #ff5c5c;
    --accent-purple: #a855f7;
    --accent-cyan: #22d3ee;

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(79, 140, 255, 0.3);

    /* Sizing */
    --sidebar-width: 240px;
    --header-height: 70px;
    --border-radius: 16px;
    --border-radius-sm: 8px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Login Page
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at top left, rgba(79, 140, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.error-message {
    background: rgba(255, 92, 92, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text-primary);
    transition: var(--transition-normal);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-login {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition-normal);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   App Layout
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-normal);
}

.nav-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active .nav-link {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
}

.user-icon {
    font-size: 20px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    background: rgba(255, 92, 92, 0.15);
    border: 1px solid var(--accent-red);
    border-radius: var(--border-radius-sm);
    color: var(--accent-red);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-normal);
}

.logout-btn:hover {
    background: var(--accent-red);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-primary);
}

.content-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.current-time {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-glass);
    border-radius: 20px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: blink 1.5s infinite;
}

.connection-status.connected .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.connection-status.disconnected .status-dot {
    background: var(--accent-red);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.content-area {
    padding: 32px;
}

/* ============================================
   Dashboard Cards
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.sensor-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.sensor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--gradient-primary));
}

.sensor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.sensor-card.temperature {
    --card-accent: linear-gradient(90deg, #ff9a9e 0%, #fecfef 100%);
}

.sensor-card.humidity {
    --card-accent: linear-gradient(90deg, #a1c4fd 0%, #c2e9fb 100%);
}

.sensor-card.pressure {
    --card-accent: linear-gradient(90deg, #d299c2 0%, #fef9d7 100%);
}

.sensor-card.co2 {
    --card-accent: linear-gradient(90deg, #84fab0 0%, #8fd3f4 100%);
}

.sensor-card.mq135 {
    --card-accent: linear-gradient(90deg, #ffecd2 0%, #fcb69f 100%);
}

.sensor-card.status {
    --card-accent: var(--gradient-primary);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    font-size: 32px;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.card-unit {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 4px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Status indicators */
.status-good {
    color: var(--accent-green);
}

.status-warning {
    color: var(--accent-orange);
}

.status-danger {
    color: var(--accent-red);
}

/* ============================================
   Charts Page
   ============================================ */

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chart-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.chart-btn {
    padding: 10px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-normal);
}

.chart-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.chart-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.chart-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.chart-canvas {
    width: 100%;
    height: 300px;
}

/* ============================================
   Logs Page
   ============================================ */

.logs-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.logs-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logs-title {
    font-size: 16px;
    font-weight: 600;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th,
.logs-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.logs-table th {
    background: var(--bg-glass);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.logs-table td {
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
}

.logs-table tr:hover td {
    background: var(--bg-glass);
}

/* ============================================
   Empty Page Placeholder
   ============================================ */

.empty-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-text {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .logo-text,
    .nav-text,
    .user-name {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 14px;
    }

    .main-content {
        margin-left: 70px;
    }

    .content-header {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card-value {
        font-size: 32px;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sensor-card {
    animation: fadeIn 0.4s ease forwards;
}

.sensor-card:nth-child(1) {
    animation-delay: 0.05s;
}

.sensor-card:nth-child(2) {
    animation-delay: 0.1s;
}

.sensor-card:nth-child(3) {
    animation-delay: 0.15s;
}

.sensor-card:nth-child(4) {
    animation-delay: 0.2s;
}

.sensor-card:nth-child(5) {
    animation-delay: 0.25s;
}

.sensor-card:nth-child(6) {
    animation-delay: 0.3s;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Refresh button */
.refresh-btn {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition-normal);
}

.refresh-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* ============================================
   Heating Page Styles
   ============================================ */

.heating-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.heating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.heating-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.heating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-warning);
}

.heating-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.heating-card .card-icon {
    font-size: 28px;
}

.heating-card .card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Relay Card */
.relay-card {
    text-align: center;
}

.relay-status {
    margin-bottom: 20px;
}

.relay-indicator {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    transition: all 0.3s ease;
    background: rgba(100, 100, 120, 0.3);
    border: 3px solid var(--text-muted);
}

.relay-indicator.on {
    background: rgba(0, 217, 126, 0.2);
    border-color: var(--accent-green);
    box-shadow: 0 0 30px rgba(0, 217, 126, 0.4);
    animation: relayPulse 2s infinite;
}

.relay-indicator.off {
    background: rgba(100, 100, 120, 0.2);
    border-color: var(--text-muted);
}

@keyframes relayPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 217, 126, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 217, 126, 0.6);
    }
}

.relay-state {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
}

.relay-state.on {
    color: var(--accent-green);
}

.relay-state.off {
    color: var(--text-muted);
}

.relay-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.relay-toggle-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.relay-toggle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.relay-toggle-btn .btn-icon {
    font-size: 20px;
}

.relay-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    display: none;
}

/* Temperature Card */
.temperature-card {
    text-align: center;
}

.current-temp {
    font-size: 56px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.temp-status {
    font-size: 14px;
    color: var(--text-secondary);
}

.temp-status.cold {
    color: var(--accent-blue);
}

.temp-status.hot {
    color: var(--accent-orange);
}

.temp-status.normal {
    color: var(--accent-green);
}

/* Mode Selection */
.mode-selector {
    display: flex;
    gap: 12px;
}

.mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-glass);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

.mode-icon {
    font-size: 24px;
}

.mode-name {
    font-size: 13px;
    font-weight: 500;
}

/* Settings Sections */
.heating-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: none;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Auto Settings */
.auto-settings-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.temp-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.temp-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    background: var(--bg-glass);
    border-radius: 4px;
    outline: none;
}

.temp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 140, 255, 0.4);
}

.temp-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 70px;
    text-align: right;
}

.temp-range-info {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.temp-range-info .temp-low {
    color: var(--accent-blue);
    font-weight: 600;
}

.temp-range-info .temp-high {
    color: var(--accent-orange);
    font-weight: 600;
}

.hysteresis-buttons {
    display: flex;
    gap: 8px;
}

.hyst-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hyst-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.hyst-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.save-btn {
    padding: 14px 24px;
    background: var(--gradient-success);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(17, 153, 142, 0.4);
}

/* Schedule Settings */
.schedule-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.schedule-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
    background: white;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
}

.schedule-entries {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-entry {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
}

.entry-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.time-start,
.time-end {
    font-size: 16px;
}

.time-sep {
    color: var(--text-muted);
}

.entry-days {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.entry-remove {
    width: 28px;
    height: 28px;
    background: rgba(255, 92, 92, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--accent-red);
    cursor: pointer;
    transition: all 0.2s ease;
}

.entry-remove:hover {
    background: var(--accent-red);
    color: white;
}

.no-entries {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.add-schedule h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.schedule-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 16px;
}

.time-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.time-group label {
    font-size: 12px;
    color: var(--text-muted);
}

.time-group input {
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.time-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.time-separator {
    font-size: 18px;
    color: var(--text-muted);
    margin-top: 20px;
}

.days-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.day-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.day-check:has(input:checked) {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.day-check input {
    display: none;
}

.add-btn {
    padding: 12px 20px;
    background: var(--gradient-info);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.4);
}

/* Heating Footer */
.heating-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.last-update {
    font-size: 13px;
    color: var(--text-muted);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    border-radius: var(--border-radius-sm);
    color: var(--accent-green);
    font-size: 14px;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Responsive for Heating */
@media (max-width: 768px) {
    .heating-grid {
        grid-template-columns: 1fr;
    }

    .mode-selector {
        flex-direction: column;
    }

    .time-inputs {
        flex-direction: column;
    }

    .time-separator {
        display: none;
    }

    .heating-footer {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================
   Calibration Section Styles
   ============================================ */

.calibration-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.calibration-warning {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 159, 67, 0.1);
    border: 1px solid var(--accent-orange);
    border-radius: var(--border-radius-sm);
    margin-bottom: 24px;
}

.warning-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.warning-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.warning-text strong {
    color: var(--accent-orange);
    display: block;
    margin-bottom: 8px;
}

.warning-text ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.warning-text li {
    margin: 4px 0;
}

.calibration-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.calibration-status .status-icon {
    font-size: 24px;
}

.calibration-status .status-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.calibration-status.pending {
    background: rgba(79, 140, 255, 0.1);
    border: 1px solid var(--accent-blue);
}

.calibration-status.pending .status-text {
    color: var(--accent-blue);
}

.calibration-status.success {
    background: rgba(0, 217, 126, 0.1);
    border: 1px solid var(--accent-green);
}

.calibration-status.success .status-text {
    color: var(--accent-green);
}

.calibration-status.error {
    background: rgba(255, 92, 92, 0.1);
    border: 1px solid var(--accent-red);
}

.calibration-status.error .status-text {
    color: var(--accent-red);
}

.calibration-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calibration-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.4);
}

.calibration-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.calibration-btn .btn-icon {
    font-size: 20px;
}

.calibration-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}