/* Hot Node Dashboard Styles */

:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --dark: #2c3e50;
  --light: #ecf0f1;
  --border: #bdc3c7;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background-color: var(--dark);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: rgba(255,255,255,0.1);
}

.auth-section {
  margin-left: auto;
}

/* Main Content */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 180px);
}

h2 {
  margin-bottom: 1.5rem;
  color: var(--dark);
}

/* Header Section */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Status Toggle */
.status-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-label {
  font-weight: bold;
  font-size: 1.1rem;
}

.status-label.enabled {
  color: var(--secondary-color);
}

.status-label.disabled {
  color: var(--danger-color);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--secondary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card.warning {
  border-left: 4px solid var(--warning-color);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content h3 {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--dark);
}

/* Card */
.card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--dark);
}

.card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: right;
}

/* Progress Bar */
.progress-bar {
  background-color: #ecf0f1;
  border-radius: 10px;
  overflow: hidden;
  height: 20px;
  margin: 0.5rem 0;
}

.progress-fill {
  background-color: var(--secondary-color);
  height: 100%;
  transition: width 0.3s;
}

.progress-fill.warning {
  background-color: var(--warning-color);
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background-color: #ecf0f1;
  font-weight: 600;
  color: var(--dark);
}

.data-table tr:hover {
  background-color: #f8f9fa;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: #7f8c8d;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-pending {
  background-color: #fef3cd;
  color: #856404;
}

.badge-valid {
  background-color: #d1ecf1;
  color: #0c5460;
}

.badge-invalid {
  background-color: #f8d7da;
  color: #721c24;
}

.badge-success {
  background-color: #d4edda;
  color: #155724;
}

.badge-error {
  background-color: #f8d7da;
  color: #721c24;
}

/* CID */
code.cid {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  background-color: #f8f9fa;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-warning {
  background-color: var(--warning-color);
  color: white;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.filter-form {
  display: flex;
  gap: 1rem;
  align-items: end;
}

.filter-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-inline {
  display: flex;
  gap: 1rem;
}

.form-inline input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Events */
.events-list {
  max-height: 400px;
  overflow-y: auto;
}

.event-item {
  padding: 1rem;
  border-left: 4px solid #ecf0f1;
  margin-bottom: 0.5rem;
  background-color: #f8f9fa;
}

.event-item.severity-error {
  border-left-color: var(--danger-color);
}

.event-item.severity-warning {
  border-left-color: var(--warning-color);
}

.event-time {
  font-size: 0.85rem;
  color: #7f8c8d;
}

.event-type {
  margin: 0.25rem 0;
}

.event-message {
  color: #555;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Config List */
.config-list {
  display: grid;
  gap: 0.75rem;
}

.config-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

/* Footer */
footer {
  background-color: var(--dark);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
  margin-top: 3rem;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: 1000;
  animation: slideIn 0.3s;
}

.notification.success {
  background-color: var(--secondary-color);
  color: white;
}

.notification.error {
  background-color: var(--danger-color);
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  max-width: 400px;
  width: 90%;
}

.modal-content h3 {
  margin-bottom: 1.5rem;
  color: var(--dark);
  text-align: center;
}

.modal-content input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-buttons button {
  flex: 1;
}

/* Disabled auth elements */
.btn-disabled-auth {
  opacity: 0.5;
  cursor: not-allowed !important;
}

input:disabled,
button:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filter-form {
    flex-direction: column;
  }

  .filter-form .form-group {
    width: 100%;
  }
}
