:root {
    --bg-dark: #1f2633;
    --card-bg: #2a3142;
    --text-light: #ffffff;
    --text-muted: #aaa;
    --primary: #ff7b54;
    --primary-hover: #e96c45;
    --radius: 16px;
  }
  
  body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
  }
  
  .app {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .navbar {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: white;
  }
  
  .temperature-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
  }
  
  .temperature-value {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
  }
  
  canvas {
    width: 100% !important;
    height: 200px !important;
  }
  
  .control-section h2 {
    margin-bottom: 15px;
    color: var(--text-muted);
  }
  
  .relay-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
  }
  
  button {
    background-color: var(--primary);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  button:hover {
    background-color: var(--primary-hover);
  }
  
  .relay-card {
    background-color: #2a3142;
    border-radius: 16px;
    padding: 12px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 0;
    font-size: 0.9rem;
  }
  
  .relay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
  }
  
  .gear-icon {
    cursor: pointer;
    font-size: 1.3rem;
  }
  
  .timer-toggle {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background-color: #555;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 15px;
    cursor: pointer;
  }
  
  .relay-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .switch-label {
    width: 50px;
    text-align: center;
    font-weight: bold;
  }
  
  .switch-track {
    width: 70px;
    height: 30px;
    background-color: #222;
    border-radius: 20px;
    position: relative;
    margin: 0 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  .switch-thumb {
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.3s ease;
  }
  
  .timer-toggle.active {
    background-color: #ff7b54;
    color: #000;
  }

  .relay-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 2px;
  }




  .modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
  }
  
  /* .modal-content {
    background-color: #2a3142;
    padding: 20px;
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  } */

  .modal-content {
    background-color: #2a3142;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 50vh; /* Add this to cap the height */
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .modal-header input {
    flex-grow: 1;
    font-size: 1.1rem;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background-color: #1f2633;
    color: #fff;
  }
  
  .close-btn {
    margin-left: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #aaa;
  }
  



  /* .schedule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  } */

  .schedule-list {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 300px; /* adjust if needed */
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }
  
  
  .schedule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1f2633;
    padding: 8px 12px;
    border-radius: 10px;
  }
  
  .schedule-row select,
  .schedule-row input[type="time"] {
    background-color: #2a3142;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
  }
  
  .schedule-row button {
    background: none;
    border: none;
    color: #ff4d4d;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
  }
  
  .add-schedule-btn {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background-color: #ff7b54;
    color: #000;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
  }
  
  .day-select {
    min-width: 70px;
  }






  .save-schedule-btn {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background-color: #22c55e;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
  }
  