/* ============================
   RESET ve GENEL STİLLER
============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  padding: 0;
  padding-top: 80px; /* header yüksekliği */
  background-color: #f0f0f0;
  min-height: 100vh;
  position: relative;
  padding-bottom: 40px; /* footer yüksekliği */
}

a {
  text-decoration: none;
  color: #333;
}

/* ============================
   HEADER
============================ */
.header-container {
  position: fixed;
  top: 0;
  width: 100%;
  background: #333;
  color: #fff;
  z-index: 1000;
  padding: 0 20px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-top {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
}

.hamburger {
  cursor: pointer;
  margin-right: 10px;
  font-size: 24px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 20px;
}

.dropdowns {
  display: flex;
  align-items: center;
}
.dropdowns > div {
  margin-right: 15px;
}
.dropdowns select {
  padding: 5px;
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.time-weather {
  text-align: right;
  margin-right: 20px;
}

.alarm-bell {
  position: relative;
  cursor: pointer;
}
.alarm-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: red;
  color: white;
  border-radius: 50%;
  padding: 2px 5px;
  font-weight: bold;
  font-size: 12px;
}

.profile-container {
  position: relative;
}

.profile-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
}
.profile-btn img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 5px;
}

.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  z-index: 999;
}

.profile-dropdown a {
  display: block;
  padding: 5px;
  color: #333;
}
.profile-dropdown a:hover {
  background: #f0f0f0;
}

/* ============================
   SIDEBAR
============================ */
#sidebar {
  position: fixed;
  top: 80px; /* header yüksekliği kadar */
  left: 0;
  width: 250px;
  height: calc(100% - 80px);
  background: #444;
  border-right: 1px solid #ccc;
  transform: translateX(-250px);
  transition: transform 0.3s ease;
  z-index: 998;
  overflow-y: auto;
}
#sidebar.open {
  transform: translateX(0);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-menu > li {
  border-bottom: 1px solid #ddd;
  padding: 8px 10px;
}
.sidebar-menu li a {
  color: #fff;
  display: block;
  padding: 8px 10px;
}
.sidebar-menu li a:hover {
  background: #555;
}
.submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

/* Top 10 Alarms Kutusu */
.top10-alarms {
  margin-top: 20px;
  padding: 10px;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.top10-alarms h4 {
  margin-bottom: 5px;
  font-size: 16px;
  color: #333;
}
.top10-alarms ul {
  list-style: none;
  padding-left: 0;
}
.top10-alarms ul li {
  font-size: 14px;
  margin-bottom: 3px;
  color: #333;
}

/* ============================
   FOOTER
============================ */
.footer-container {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 5px;
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 997;
}

/* ============================
   DASHBOARD CONTENT
============================ */
.dashboard-content {
  margin-left: 250px; /* sidebar genişliği */
  margin-right: 20px;
  margin-bottom: 60px;
  padding: 10px;
  transition: margin-left 0.3s ease;
}

/* KPI KARTLARI (dashboard.php) */
.kpi-card {
  width: 220px;
  padding: 25px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #007BFF, #00BFFF);
  border-radius: 8px;
  margin: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  position: relative;
}
.kpi-card i {
  font-size: 40px;
  margin-bottom: 10px;
}

/* Yanıp sönme animasyonu */
@keyframes blinkAnim {
  0%   { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 1; }
}

/* KPI kartlarında aktif alarm (kırmızı) ve offline (sarı) efekti */
.active-alarms {
  background: linear-gradient(135deg, #FF0000, #FF5555);
  animation: blinkAnim 1s infinite;
}
.offline-blink {
  background: linear-gradient(135deg, #FFC107, #FFEB3B);
  animation: blinkAnim 1s infinite;
}

/* ============================
   SENSÖR KARTI
============================ */
.sensor-card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.sensor-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  width: 280px;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.sensor-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.sensor-card-header {
  background: transparent;
  color: #333;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

.sensor-name {
  font-weight: bold;
}

.sensor-batt {
  font-size: 14px;
}

.sensor-card-body {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  background: transparent;
}

.sensor-card-body .big-val {
  font-size: 36px;
  font-weight: bold;
  display: block;
  margin: 5px 0;
}

.sensor-card-info {
  padding: 10px 15px;
  font-size: 14px;
  color: #666;
  background: transparent;
  border-top: 1px solid rgba(0,0,0,0.1);
  text-align: center;
}

/* Alarm/Offline blink */
.blink-alarm {
  background: linear-gradient(135deg, #FF0000, #FF5555) !important;
  animation: blinkAnim 1s infinite;
  color: #fff !important;
}
.blink-offline {
  background: linear-gradient(135deg, #FFC107, #FFEB3B) !important;
  animation: blinkAnim 1s infinite;
  color: #333 !important;
}

/* ============================
   LOGIN BOX (örnek)
============================ */
.login-box {
  width: 300px;
  margin: 100px auto;
  background: rgba(255,255,255,0.5);
  padding: 20px;
  border-radius: 5px;
}

/* Form ve Button */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 6px;
  margin: 5px 0;
  border: 1px solid #ccc;
}

button {
  padding: 8px 16px;
  cursor: pointer;
  border: none;
  background: #444;
  color: #fff;
  margin: 5px 0;
}
button:hover {
  background: #333;
}

/* Tablo Genel */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}
table th, table td {
  border: 1px solid #ddd;
  padding: 8px;
}

/* Grafik Kartı (dashboard.php) */
.chart-card {
  display: flex;
  flex-direction: row;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  margin-top: 20px;
  max-width: 950px;
  margin-left: 0;
  margin-right: 0;
}
.chart-card-controls {
  flex: 0 0 200px;
  padding: 15px;
  background: #f9f9f9;
  border-right: 1px solid #ddd;
}
.chart-card-controls label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 14px;
  margin-top: 10px;
}
.chart-card-controls select {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
}
.chart-card-chart {
  flex: 1;
  position: relative;
  padding: 10px 20px 40px 20px;
  height: 400px;
}
.chart-card-chart h3 {
  margin-bottom: 10px;
}
.chart-timeline {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #333;
  background: rgba(255,255,255,0.8);
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* ============================
   YENİ EKLENEN SINIFLAR
   (Kapalı sensör için solgun görünüm)
============================ */

/* Kapalı (enable=0) sensörler solgun gözüksün */
.disabled-sensor {
  opacity: 0.5;
  filter: grayscale(20%);
}

/* Sensör kapalı ibaresi */
.sensor-off {
  color: red;
  font-weight: bold;
  margin-top: 5px;
}
/* iPhone tarzı switch - boyut: 38x20 piksel (dilerseniz değiştirebilirsiniz) */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  vertical-align: middle;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; /* Kapalı durumdaki renk */
  transition: .4s;
  border-radius: 20px; /* Yuvarlak kenarlar */
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #fff; /* Düğme rengi */
  transition: .4s;
  border-radius: 50%;
}

/* BURADAKİ RENGİ DEGİSTİREREK MAVİ YERİNE YESIL YAPIYORUZ */
input:checked + .slider {
  background-color: #4CAF50; /* Örn: #28a745 veya başka bir yeşil kodu */
}

/* Odaklanınca mavi gölge yerine yeşil de yapabilirsiniz */
input:focus + .slider {
  box-shadow: 0 0 1px #4CAF50;
}

/* Düğme yer değiştirdiğinde */
input:checked + .slider:before {
  transform: translateX(18px);
}
