* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  font-family: "Segoe UI", sans-serif;
  background: #e8f5e9;
  color: #1b5e20;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.header {
  width: 100%;
  max-width: 480px;
  background: #c8e6c9;
  border-radius: 20px 20px 0 0;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #2e2e2e;
  flex-grow: 1;
}

.btn-install {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #2e2e2e;
}

.container {
  width: 100%;
  max-width: 480px;
  height: calc(100vh - 80px);
  background: #fff;
  border-radius: 0 0 20px 20px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 128, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex-grow: 1;
}

.hidden {
  display: none;
}

#location-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.location-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.btn-group {
  display: flex;
  gap: 8px;
}

button {
  padding: 8px 14px;
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-green {
  background-color: #66bb6a;
}
.btn-green:hover {
  background-color: #388e3c;
}

.btn-blue {
  background-color: #42a5f5;
}
.btn-blue:hover {
  background-color: #1e88e5;
}

.btn-red {
  background-color: #ef5350;
}
.btn-red:hover {
  background-color: #d32f2f;
}

.btn-orange {
  background-color: #ffa726;
}
.btn-orange:hover {
  background-color: #fb8c00;
}

.btn-icon {
  background-color: #333333;
}
.btn-icon:hover {
  background-color: #000000;
}

.input-button-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

#location-picker {
  background-color: #e3f2fd;
  border-left: 4px solid #1e88e5;
  border-radius: 8px;
  padding: 10px 12px;
}

#city-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-top: 6px;
  margin-bottom: 8px;
}

#suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0 0 8px 8px;
  max-height: 150px;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

#suggestions li {
  padding: 10px;
  cursor: pointer;
}

#suggestions li:hover {
  background-color: #c8e6c9;
}

#clock-section {
  background: #f1f8e9;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.schedule li {
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.95rem;
}

.schedule h2 {
  font-size: 1rem;
  margin-bottom: 8px;
  white-space: pre-line;
}

.footer {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  padding: 12px 0;
  border-top: 1px solid #eee;
  flex-shrink: 0;
  background: #f9f9f9;
}

.footer a {
  text-decoration: none;
  color: #666;
}

#qibla-result {
  background-color: #fff3e0;
  border-left: 4px solid #fb8c00;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

#monthly-schedule {
  background-color: #efefef;
  border-left: 4px solid #000000;
  border-radius: 8px;
  padding: 10px 12px;
  /* font-size: 0.9rem; */
}

#monthly-schedule h2 {
  margin-top: 0;
  font-size: 0.9rem;
}

.table-container {
  overflow-x: auto;
  margin-top: -5px;
  max-height: 200px;
}

table {
  min-width: 650px;
  border-collapse: collapse;
  font-size: 0.7rem;
  background-color: #ffffff;
}

table th,
table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

table th {
  background-color: #e0f2f1;
  font-weight: bold;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 768px) {
  .wrapper {
    height: 100dvh;
  }

  .header {
    border-radius: 0;
    padding: 12px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .btn-install {
    font-size: 1.4rem;
  }

  .container {
    padding: 16px;
    border-radius: 0;
    height: auto;
    box-shadow: none;
    max-height: none;
    flex-grow: 1;
  }

  #location-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .location-info {
    font-size: 0.9rem;
    flex-wrap: wrap;
  }

  .btn-group {
    flex-wrap: nowrap;
    gap: 6px;
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
  }

  .btn-group button {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    padding: 8px 4px;
  }

  button {
    flex: 1 1 30%;
    min-width: 90px;
    font-size: 0.8rem;
    padding: 8px;
  }

  .input-button-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  #city-input {
    flex: 1;
    min-width: 0;
  }

  .input-button-group button {
    white-space: nowrap;
    max-width: 90px;
    flex-shrink: 0;
  }

  #suggestions {
    max-height: 200px;
  }

  #clock-section {
    font-size: 0.9rem;
  }

  .schedule h2 {
    font-size: 0.95rem;
  }

  .schedule li {
    font-size: 0.9rem;
    padding: 6px 0;
  }

  .footer {
    font-size: 0.75rem;
    padding: 8px 0;
  }

  #qibla-result {
    font-size: 0.85rem;
    padding: 8px 10px;
  }

  #monthly-schedule {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  #monthly-schedule h2 {
    font-size: 0.85rem;
  }

  .table-container {
    max-height: 200px;
    overflow-x: auto;
    overflow-y: auto;
  }

  table {
    font-size: 0.75rem;
    min-width: 650px;
  }

  table th,
  table td {
    padding: 6px;
    white-space: nowrap;
  }
}
