body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

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

/* Desktop layout - 2x2 grid */
.grid-container {
  display: grid;
  /* grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr; */
  gap: 20px;
  height: calc(100vh - 40px);
  grid-auto-flow: row;
}

.panel {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

/* Top-left: Form panel */
.form-panel {
  align-items: center;
  justify-content: center;
}

/* Bottom-left: Domain info panel */
.domain-info-panel {
  align-items: center;
  justify-content: center;
}

/* Top-right: Snapshots chart */
#chartSection {
  grid-column: 2;
  grid-row: 1;
}

/* Bottom-right: Traffic chart */
#trafficChartSection {
  grid-column: 2;
  grid-row: 2;
}

h1 {
  text-align: center;
  font-size: 24px;
  margin-top: 0;
}

h2 {
  text-align: center;
  margin-top: 5px;
  margin-bottom: 30px;
  font-size: 20px;
}

h3 {
  margin-top: 0;
  text-align: center;
}

.form-group {
  margin-bottom: 25px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input[type='text'] {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
}

input[type='text']:focus {
  border-color: #4caf50;
  outline: none;
}

button {
  background-color: #4caf50;
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
}

button:hover {
  background-color: #45a049;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.loading {
  text-align: center;
  margin: 20px 0;
}

.domain-info h3 {
  margin-bottom: 15px;
  font-size: 18px;
}

.info-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.info-item {
  margin-bottom: 15px;
  padding: 12px;
  border-radius: 4px;
  border-left: 4px solid #4caf50;
}

.info-label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.info-value {
  font-size: 14px;
}

.error {
  border-left: 4px solid #f44336;
  color: #c62828;
  padding: 20px;
  border-radius: 4px;
  margin: 20px 0;
  text-align: center;
}

#snapshotChart,
#trafficChart {
  width: 100% !important;
  height: 100% !important;
  min-height: 300px;
}

.chart-title {
  text-align: center;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: bold;
}

.no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: #666;
  font-size: 18px;
  border-radius: 8px;
  border: 2px dashed #ddd;
}

.chart-container {
  border-radius: 8px;
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Mobile layout - stacked panels */
@media (max-width: 768px) {
  .main-container {
    padding: 10px;
  }

  .grid-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: auto;
  }

  .panel {
    min-height: auto;
  }

  #snapshotChart,
  #trafficChart {
    min-height: 300px;
  }

  /* On mobile, reset grid positions */
  .form-panel,
  .domain-info-panel,
  #chartSection,
  #trafficChartSection {
    grid-column: unset;
    grid-row: unset;
  }
}

/* Initially hide result panels except form */
.domain-info-panel:not(.show),
#chartSection:not(.show),
#trafficChartSection:not(.show) {
  display: none;
}

/* Show panels when results are available */
.show {
  display: flex !important;
}
