/* Custom styles for dashboard */
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f3ff;
}

section {
  margin-bottom: 2rem;
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 100px;
  background-color: #4c51bf;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
}

.sidebar-item {
  width: 100%;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.sidebar-item:hover {
  background-color: #5a5fd7;
}

.sidebar-item.active {
  background-color: #5a5fd7;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar-item i {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.sidebar-text {
  font-size: 0.7rem;
  text-align: center;
  color: #e2e4fd;
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
  padding: 1rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.search-box {
  background-color: white;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  width: 300px;
}

.search-box input {
  border: none;
  outline: none;
  flex: 1;
  margin-right: 0.5rem;
}

.search-box button {
  background-color: #4c51bf;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.full-width-card {
  grid-column: span 2;
}

/* Styling for modern chart container */
.modern-chart-container {
  background-color: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-labels {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.chart-label {
  display: flex;
  align-items: center;
  margin: 0 10px;
  font-size: 0.875rem;
}

.dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.blue-dot {
  background-color: #6366f1;
}

.orange-dot {
  background-color: #f97316;
}

.stat-card {
  padding: 1rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: bold;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
}

.chart-container {
  width: 100%;
  height: 200px;
  margin: 1rem 0;
}

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

.site-table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  color: #6b7280;
  font-weight: 500;
}

.site-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  display: inline-block;
}

.status-active {
  background-color: #def7ec;
  color: #0e9f6e;
}

.status-maintenance {
  background-color: #fef3c7;
  color: #d97706;
}

.status-inactive {
  background-color: #f3f4f6;
  color: #6b7280;
}

.up-trend {
  color: #0e9f6e;
}

.down-trend {
  color: #e02424;
}

.progress-circle {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Site Tree Styles */
.site-tree {
  width: 100%;
}

.zone-item {
  margin-bottom: 1rem;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  overflow: hidden;
}

.zone-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  cursor: pointer;
  transition: background-color 0.2s;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.add-button {
  background-color: #4c51bf;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.add-button:hover {
  background-color: #5a5fd7;
}

.zone-header:hover {
  background-color: #f3f4f6;
}

.zone-toggle {
  margin-right: 0.75rem;
  transition: transform 0.2s;
}

.zone-toggle.rotate {
  transform: rotate(90deg);
}

.zone-name {
  font-weight: 600;
  flex: 1;
}

.zone-stats {
  color: #6b7280;
  font-size: 0.875rem;
}

.site-header-labels {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  background-color: #f3f4f6;
  border-radius: 4px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
}

.site-list {
  display: none; /* Initially hidden */
  padding: 0.5rem 0;
}

.site-list.show {
  display: block;
}

.site-item {
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.site-item:last-child {
  border-bottom: none;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.site-header:hover {
  background-color: #f9fafb;
}

.site-name {
  font-weight: 500;
  min-width: 180px;
}

.daily-sales {
  font-weight: 500;
  color: #047857;
  min-width: 80px;
}

.availability {
  color: #4b5563;
  min-width: 80px;
}

.uptime {
  color: #4b5563;
  min-width: 80px;
}

.last-update {
  color: #6b7280;
  font-size: 0.875rem;
  min-width: 150px;
}

.site-details {
  display: none; /* Hide old details */
  gap: 0.5rem;
  font-size: 0.875rem;
}

.detail-row {
  display: flex;
  align-items: center;
}

.detail-label {
  color: #6b7280;
  margin-right: 0.5rem;
}

.detail-actions {
  grid-column: span 2;
  margin-top: 0.5rem;
  text-align: right;
}

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

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-50px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 1rem;
  background-color: #f3f4f6;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.close-modal {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
}

.close-modal:hover {
  color: #111827;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: #4c51bf;
  color: white;
}

.btn-primary:hover {
  background-color: #5a5fd7;
}

.btn-secondary {
  background-color: #e5e7eb;
  color: #374151;
}

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

.btn-info {
  background-color: #60a5fa;
  color: white;
}

.btn-info:hover {
  background-color: #3b82f6;
}

.mt-4 {
  margin-top: 1rem;
}

.members-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.members-table th,
.members-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.members-table th {
  font-weight: 500;
  color: #6b7280;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.edit-btn:hover {
  color: #4c51bf;
}

.delete-btn:hover {
  color: #ef4444;
}

.site-list-in-modal {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.progress-circle-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 8;
}

.progress-circle-value {
  fill: none;
  stroke: #4c51bf;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.3s;
}

.progress-text {
  position: absolute;
  font-size: 1.75rem;
  font-weight: bold;
}
