/* Modern CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #4361ee;
  --secondary-color: #8d99ae;
  --success-color: #2ecc71;
  --danger-color: #e63946;
  --light-color: #f8f9fa;
  --dark-color: #2b2d42;
  --accent-color: #48cae4;
  --background-gradient-1: #1a1a2e;
  --background-gradient-2: #16213e;
  --card-background: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.1);
}

/* =============================================================================
   BASE STYLES & RESET
   ============================================================================= */
html,
body {
  width: 100%;
  height: 100%;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(
    135deg,
    var(--background-gradient-1) 0%,
    var(--background-gradient-2) 100%
  );
  color: white;
  overflow-x: hidden;
  overflow-y: auto;
}

/* =============================================================================
   LAYOUT COMPONENTS
   ============================================================================= */
.container {
  max-width: 1200px;
  padding: 10px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.status-card {
  padding: 20px;
  margin: 20px auto;
  max-width: 600px;
  width: 100%;
  animation: fadeIn 0.5s ease-out;
}

.status-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--accent-color);
  position: relative;
}

.status-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
}

@media (min-width: 768px) {
  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================================================
   STATUS COMPONENTS
   ============================================================================= */
.status-item {
  padding: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

.status-item:nth-child(n) {
  animation-delay: calc(n * 0.1s);
}

.status-item:hover {
  border-bottom-color: var(--accent-color);
  background: linear-gradient(to right, rgba(72, 202, 228, 0.05), transparent);
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--secondary-color);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.status-item:hover .status-label {
  color: var(--accent-color);
}

.status-value {
  font-weight: 600;
  color: white;
  font-size: 1rem;
  text-align: right;
}

.status-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* =============================================================================
   RADIUS STATUS COMPONENTS
   ============================================================================= */
.radius-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 8px;
  transition: all 0.3s ease;
}

.radius-status .radius-status-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Optimasi: Specificity tinggi untuk override fill behavior */
.radius-status .radius-status-icon circle:not([fill="currentColor"]),
.radius-status .radius-status-icon path:not([fill="currentColor"]) {
  fill: none;
  stroke: currentColor;
}

.radius-status .radius-status-icon circle[fill="currentColor"],
.radius-status .radius-status-icon path[fill="currentColor"] {
  fill: currentColor;
  stroke: none;
}

.radius-on {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.radius-off {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.2);
}

/* =============================================================================
   BUTTON COMPONENTS
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  height: 40px;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-danger {
  padding: 0.5rem 1.5rem;
  min-width: 120px;
  background: var(--danger-color);
  color: white;
}

/* .btn-refresh {
  padding: 0.5rem;
  width: 40px;
  background: var(--accent-color);
  color: white;
} */

/* .btn-refresh:hover {
  background: #3498db;
} */

/* .btn-refresh:hover svg {
  transform: rotate(180deg);
} */

/* .btn-refresh svg {
  width: 24px;
  height: 24px;
} */

.btn-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.button-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.last-update {
  text-align: center;
  color: var(--secondary-color);
  font-size: 0.8rem;
  margin-top: 10px;
}

/* =============================================================================
   ANIMATIONS & UTILITIES
   ============================================================================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.connected {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #4caf50;
  border-radius: 50%;
  margin-right: 5px;
  animation: pulse 2s infinite;
}

.warning-text {
  font-size: 0.9rem !important;
  font-weight: normal !important;
  color: #9acd32 !important;
  margin-top: 10px !important;
  display: block;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */
@media (max-width: 768px) {
  .status-card {
    margin: 10px;
    padding: 15px;
  }

  .status-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .button-container {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .btn-danger {
    min-width: 100px;
  }
}

/* =============================================================================
   MODAL COMPONENTS (Optional - if needed)
   ============================================================================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100%;
  height: 100%;
  overflow: auto;
  outline: 0;
  display: none;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: 90%;
  max-width: 400px;
  margin: 1.75rem auto;
  pointer-events: none;
  transform: translateY(-50px);
  transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
  transform: translateY(0);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background: linear-gradient(145deg, #252538 0%, #1a1a2e 100%);
  background-clip: padding-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  outline: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.modal-header:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.btn-close {
  padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
  }
}
