/* === RESET & GLOBAL === */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f7fb;
  color: #00264d;
  font-size: 13px;
  height: 100%;
}

/* === HEADER === */
.header {
  background-color: #003366;
  color: white;
  padding: 5px 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.header h1 {
  margin: 0;
  font-size: 28px;
}
.header p {
  margin-top: 5px;
  font-size: 12px;
}
.header-logo {
  display: flex;
  align-items: center;
}
.header-logo img {
  height: 50px;
  margin-right: 10px;
}

/* === CUACA HEADER === */
.header-cuaca-right {
  max-width: 60%;
  overflow: hidden;
  white-space: nowrap;
  background-color: #003366;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  color: white;
}
.cuaca-anim {
  transition: transform 0.5s ease-in-out;
  width: 100%;
}
.cuaca-item {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  height: 30px;
}
.cuaca-item img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* === MAIN LAYOUT === */
.main {
  display: flex;
  flex-wrap: wrap;
  padding: 10px;
  gap: 10px;
  min-height: calc(100vh - 160px);
  box-sizing: border-box;
}
.left, .right {
  background: white;
  border-radius: 10px;
  padding: 15px;
  flex: 1;
  min-width: 200px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  box-sizing: border-box;
}
.left h2, .right h3 {
  color: #003366;
  margin-bottom: 5px;
}

/* === RIGHT SIDE SPLIT === */
.right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  text-align: center;
}
.right-top,
.right-bottom {
  background: white;
  border-radius: 10px;
  padding: 10px;
  flex: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  box-sizing: border-box;
}
.right-top {
  flex: 2;
}
.right-bottom {
  flex: 1;
}

/* === TABLE UMUM === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
th, td {
  border: 1px solid #b0c4de;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}
th {
  background-color: #cde6ff;
  color: #00264d;
}

/* === VIDEO & DIAGRAM === */
.video-card, .diagram-card {
  margin-bottom: 10px;
}
.diagram {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  border: 1px solid #ddd;
}

/* === MARQUEE === */
.marquee {
  background-color: #00264d;
  color: white;
  padding: 10px 0;
  font-weight: bold;
  font-size: 12px;
  position: fixed;
  bottom: 0;
  width: 100%;
  overflow: hidden;
  z-index: 999;
}

.marquee-content {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  animation: slide-left 40s linear infinite;
}

.marquee-content img {
  height: 18px;
  vertical-align: middle;
  margin-right: 2px; /* Jarak kecil antara gambar dan teks */
}

@keyframes slide-left {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}


/* === JAM & COUNTDOWN === */
.jam-kotak,
.countdownReload {
  background-color: #fffbe6;
  color: #003366;
  padding: 5px 12px;
  font-weight: bold;
  font-family: 'Segoe UI', monospace;
  font-size: 13px;
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.3);
  position: fixed;
  bottom: 6px;
  height: 20px;
  display: flex;
  align-items: center;
}

.jam-kotak {
  left: 0px;
}

.countdownReload {
  right: 0px;
}

.cuaca-kotak {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: #fffbe6;
  color: #003366;
  padding: 5px 12px;
  font-weight: bold;
  font-family: 'Segoe UI', monospace;
  font-size: 13px;
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cuaca-kotak img {
  width: 24px;
  height: 24px;
}

/* === TABLE WRAPPER === */
.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  margin-top: 20px;
}
.table-wrapper table {
  border-collapse: separate;
  border-spacing: 0 10px;
  width: 100%;
  font-size: 12px;
}
.table-wrapper thead th {
  background: linear-gradient(90deg, #003366 0%, #3399ff 100%);
  color: white;
  font-weight: 600;
  padding: 8px;
  text-align: center;
  border-radius: 8px 8px 0 0;
}
.table-wrapper tbody tr {
  background: #eef7ff;
  transition: background-color 0.3s ease;
  border-radius: 8px;
}
.table-wrapper tbody tr:hover {
  background: #d0eaff;
}
.table-wrapper td {
  padding: 8px;
  text-align: center;
  vertical-align: top;
  border: none;
  color: #2c3e50;
}
.table-wrapper td:first-child {
  font-weight: 600;
  color: #003366;
  text-align: left;
  padding-left: 10px;
}
.cuaca-suhu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
}
.cuaca-suhu img {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.2));
}

/* === ERROR TEXT === */
.error {
  color: #c0392b;
  font-style: italic;
  text-align: center;
  margin-top: 15px;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .main {
    flex-direction: column;
  }
  
  .header {
    flex-direction: column;
    text-align: center;
  }
  
  .header-cuaca-right {
    max-width: 100%;
    margin-top: 10px;
  }
  
  .jam-kotak, .countdownReload {
    font-size: 11px;
    padding: 3px 8px;
  }
}

/* === LOADING INDICATOR === */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,51,102,0.3);
  border-radius: 50%;
  border-top-color: #003366;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
