    * {
      box-sizing: border-box;
    }
    body {
      font-family: 'Vazir', sans-serif;
      margin: 0;
      padding: 0;
      background: #f0f4f7;
      direction: rtl;
      line-height: 1.6;
      color: #333;
    }

    header {
      background: linear-gradient(90deg, #1d976c, #93f9b9);
      color: #fff;
      padding: 15px 15px 40px; 
      position: relative;
      text-align: center;
      font-size: 1.8em;
      box-shadow: 0px 2px 5px rgba(0,0,0,0.2);
    }


    .language-bar {
      position: absolute;
      top: 25px;
      left: 10px; 
      display: flex;
      gap: 5px;
    }
    .lang-btn {
      background: #fff;
      color: #1d976c;
      border: none;
      border-radius: 8px;
      padding: 12px 12px;
      cursor: pointer;
      font-size: 0.6em;
      text-decoration: none;
      display: inline-block;
      /* font-weight: bold; */
      transition: background 0.3s, transform 0.2s;
    }
    .lang-btn:hover {
      background: #c8ecd5;
      transform: scale(1.05);
    }

    .slider-container {
      position: relative;
      overflow: hidden;
      width: 100%;
      aspect-ratio: 16/9;
      margin-bottom: 30px;
    }
    .slider-container img {
      position: absolute;
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: none;
    }
    .slider-container img.active {
      display: block;
      animation: fadeIn 1s;
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }

    .info-section {
      background: #fff;
      margin: 20px;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .info-section h2 {
      margin-top: 0;
      text-align: center;
      color: #1d976c;
    }
    .info-content {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
      margin-bottom: 20px;
    }
    .info-block {
      flex: 1 1 300px;
      margin: 10px;
      padding: 10px;
      border-left: 4px solid #1d976c;
    }
    .info-block h3 {
      margin-top: 0;
      color: #555;
    }

    .benefits {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 20px;
    }
    .benefit {
      background: #f9f9f9;
      padding: 10px 20px;
      border-radius: 8px;
      text-align: center;
      box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }
    .benefit i {
      font-size: 2em;
      color: #1d976c;
      margin-bottom: 5px;
    }

    .ajax-start {
      display: block;
      width: 200px;
      margin: 20px auto;
      padding: 12px 20px;
      background: #5bc0de;
      color: #fff;
      border: none;
      border-radius: 5px;
      font-size: 1.1em;
      cursor: pointer;
      transition: background 0.3s ease;
      text-align: center;
    }
    .ajax-start:hover {
      background: #31b0d5;
    }
    #ajaxLoading {
      text-align: center;
      font-size: 1.2em;
      color: #1d976c;
    }

    .system-management {
      display: none;
      padding: 20px;
    }

    .container {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
    }

    .devices {
      flex: 1 1 350px;
      background: #fff;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .devices h2 {
      text-align: center;
      color: #333;
    }

    .device {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 0;
      border-bottom: 1px dashed #ddd;
    }
    .device:last-child {
      border-bottom: none;
    }
    .device-info {
      display: flex;
      flex-direction: column;
    }
    .device-name {
      font-weight: bold;
      color: #555;
    }
    .device-power {
      font-size: 0.9em;
      color: #888;
    }

    button.toggle-btn {
      padding: 8px 12px;
      border: none;
      border-radius: 4px;
      background: #1d976c;
      color: #fff;
      cursor: pointer;
      transition: background 0.3s ease;
    }
    button.toggle-btn.off {
      background: #d9534f;
    }
    button.toggle-btn:hover {
      opacity: 0.9;
    }

    .controls {
      text-align: center;
      margin-top: 20px;
    }
    .energy-save {
      background: #ff9800;
      color: #fff;
      border: none;
      border-radius: 8px;
      padding: 10px 20px;
      font-size: 1em;
      cursor: pointer;
      transition: transform 0.3s ease, background 0.3s ease;
      display: inline-block;
    }
    .energy-save:hover {
      background: #e68900;
      transform: scale(1.05) rotate(1deg);
    }

    .add-device {
      margin-top: 20px;
      padding-top: 15px;
      border-top: 1px solid #eee;
    }
    .add-device h3 {
      margin-bottom: 10px;
      color: #333;
    }
    .add-device input,
    .add-device label {
      display: block;
      width: 100%;
      margin: 5px 0;
      font-size: 1em;
    }
    .add-device input[type="text"],
    .add-device input[type="number"] {
      padding: 8px;
      border: 1px solid #ccc;
      border-radius: 4px;
      transition: border-color 0.3s;
    }
    .add-device input[type="text"]:focus,
    .add-device input[type="number"]:focus {
      border-color: #1d976c;
      outline: none;
    }

    .essential-container {
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 5px 0;
    }
    .essential-container label {
      width: auto;
      margin: 0 10px;
      display: inline-flex;
      align-items: center;
      font-size: 1em;
      cursor: pointer;
    }
    .essential-container input[type="radio"] {
      accent-color: #1d976c;
      margin-left: 5px;
    }

    .add-device button {
      margin-top: 10px;
      padding: 10px 15px;
      border: none;
      border-radius: 5px;
      background: #5bc0de;
      color: #fff;
      cursor: pointer;
      transition: background 0.3s ease;
    }
    .add-device button:hover {
      background: #31b0d5;
    }

    .device-success {
      margin-top: 10px;
      padding: 10px;
      background: #dff0d8;
      color: #3c763d;
      border: 1px solid #d6e9c6;
      border-radius: 4px;
      text-align: center;
      opacity: 0;
      transition: opacity 0.5s ease-in-out;
    }
    .device-success.show {
      opacity: 1;
    }

    .monitor {
      flex: 2 1 550px;
      background: #fff;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .monitor h2 {
      text-align: center;
      color: #333;
    }
    .energy-display {
      font-size: 1.2em;
      text-align: center;
      margin: 15px 0;
      color: #333;
    }

    .chart-tabs {
      text-align: center;
      margin-bottom: 10px;
    }
    .chart-tabs button {
      padding: 8px 15px;
      margin: 0 5px;
      background: #ddd;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      transition: background 0.3s ease;
    }
    .chart-tabs button.active {
      background: #1d976c;
      color: #fff;
    }

    .chart-container {
      width: 100%;
      max-width: 800px;
      margin: 0 auto;
    }

    .alert {
      text-align: center;
      padding: 10px;
      background: #d9534f;
      color: #fff;
      border-radius: 5px;
      margin: 10px auto;
      max-width: 400px;
      display: none;
    }

    .loading {
      text-align: center;
      font-size: 1.2em;
      color: #1d976c;
    }

    @media (max-width: 768px) {
      .container {
        flex-direction: column;
      }
      .devices, .monitor {
        flex: 1 1 auto;
        margin-bottom: 20px;
      }
      .language-bar {
        position: static;
        margin-bottom: 10px;
        justify-content: center;
      }
      header {
        padding: 20px;
      }
    }
