
/* =========================================
   1. GLOBAL RESET
========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: clip;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #ffffff;
  background: url("bg.jpg") center center / cover no-repeat;
  background-attachment: fixed;
  position: relative;
  isolation: isolate;
}

/* Background overlay */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: -1;
  pointer-events: none;
}

/* All common text white */

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
span,
small,
strong,
.card,
.card-item {
  color: #ffffff;
}

/* =========================================
   2. NAVBAR
========================================= */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  min-height: 65px;
  padding: 12px 24px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  background: rgba(0, 0, 0, 0.82);
  z-index: 1000;
}

.navbar h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #ffffff;
  font-size: 24px;
  overflow-wrap: anywhere;
}

/* =========================================
   3. CLOCK
========================================= */

#clock {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 55%;
  margin: 0;
  padding: 0;

  color: #ffffff;
  font-size: 15px;
  line-height: 1.5;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* =========================================
   4. MAIN CONTAINER
========================================= */

.container {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;

  margin: 0;
  padding: 100px 20px 30px;
}

/* =========================================
   5. MAIN CARD
========================================= */

.card {
  width: 100%;
  max-width: 500px;
  min-width: 0;

  margin: 0 auto;
  padding: 25px;

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;

  background: rgba(20, 25, 35, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  text-align: center;
}

/* =========================================
   6. INPUTS
========================================= */

input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;

  margin: 8px 0 0;
  padding: 12px;

  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  outline: none;

  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;

  font-family: inherit;
  font-size: 16px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

/* Dropdown options */

select option {
  color: #ffffff;
  background: #1e293b;
}

/* =========================================
   7. BUTTONS
========================================= */

button {
  max-width: 100%;
  margin-top: 10px;
  padding: 11px 16px;

  border: none;
  border-radius: 8px;

  background: #2563eb;
  color: #ffffff;

  font-family: inherit;
  font-size: 15px;
  cursor: pointer;

  overflow-wrap: anywhere;
  transition: background 0.2s ease;
}

button:hover {
  background: #1d4ed8;
}

button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

/* =========================================
   8. HIDDEN ELEMENTS
========================================= */

.hidden {
  display: none !important;
}

/* =========================================
   9. WEATHER ICON
========================================= */

#icon {
  display: block;
  width: 80px;
  max-width: 100%;
  height: auto;
  margin: 10px auto;
  object-fit: contain;
}

/* =========================================
   10. FORECAST
========================================= */

#forecast {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;

  width: 100%;
  min-width: 0;
  margin-top: 15px;
}

.card-item {
  flex: 1 1 65px;
  min-width: 0;
  max-width: 100%;

  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.12);
  text-align: center;
  overflow-wrap: anywhere;
}

/* =========================================
   11. MAP MODAL
========================================= */

#mapModal {
  display: none;
  position: fixed;
  inset: 0;

  width: 100%;
  height: 100%;
  height: 100dvh;

  margin: 0;
  padding: 0;

  background: #0f172a;
  z-index: 2000;
  overflow: hidden;
}

/* Optional class-based opening */

#mapModal.active {
  display: block;
}

/* =========================================
   12. MAP WRAPPER
========================================= */

.map-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 15px;

  width: 100%;
  height: 100%;

  margin: 0;
  padding: 20px;
  overflow: hidden;
}

/* =========================================
   13. MAP SIDEBAR
========================================= */

.sidebar {
  flex: 0 0 260px;
  width: 260px;
  min-width: 0;
  min-height: 0;

  padding: 15px;
  border-radius: 10px;

  background: #1e293b;
  color: #ffffff;

  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar h2,
.sidebar h3,
.sidebar p,
.sidebar label,
.sidebar span {
  color: #ffffff;
}

.sidebar input,
.sidebar select,
.sidebar textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* =========================================
   14. MAP AREA
========================================= */

#map {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;

  margin: 0;
  padding: 0;
  border-radius: 10px;

  background: #e2e8f0;
  overflow: hidden;
}

/* Ensure embedded map fills its container */

#map iframe,
#map > div {
  max-width: 100%;
}

/* =========================================
   15. CLOSE BUTTON
========================================= */

.close-btn {
  position: absolute;
  top: 12px;
  right: 15px;

  z-index: 3000;
  margin: 0;
  padding: 10px 13px;

  border: none;
  border-radius: 50%;

  background: #dc2626;
  color: #ffffff;
  cursor: pointer;
}

.close-btn:hover {
  background: #b91c1c;
}

/* =========================================
   16. TABLETS
========================================= */

@media (max-width: 768px) {
  .navbar {
    gap: 10px;
    padding: 12px 16px;
  }

  .navbar h2 {
    font-size: 21px;
  }

  #clock {
    max-width: 48%;
    font-size: 14px;
  }

  .container {
    padding: 95px 16px 25px;
  }

  .card {
    max-width: 460px;
    padding: 22px;
  }

  .map-wrapper {
    gap: 10px;
    padding: 15px;
  }

  .sidebar {
    flex-basis: 220px;
    width: 220px;
    padding: 12px;
  }
}

/* =========================================
   17. MOBILE
========================================= */

@media (max-width: 480px) {
  .navbar {
    min-height: 58px;
    padding: 10px 12px;
    gap: 8px;
  }

  .navbar h2 {
    flex: 1 1 0;
    font-size: 18px;
    line-height: 1.3;
  }

  #clock {
    flex: 0 1 45%;
    width: auto;
    max-width: 45%;
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .container {
    padding: 85px 12px 20px;
  }

  .card {
    width: 100%;
    max-width: 100%;
    padding: 18px 14px;
    border-radius: 12px;
  }

  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    padding: 11px;
    font-size: 16px;
  }

  #icon {
    width: 70px;
  }

  #forecast {
    gap: 6px;
  }

  .card-item {
    flex: 1 1 58px;
    padding: 8px 4px;
    font-size: 13px;
  }

  /* Portrait mobile map */

  .map-wrapper {
    flex-direction: column;
    gap: 10px;
    padding: 55px 10px 10px;
  }

  .sidebar {
    flex: 0 0 auto;
    width: 100%;
    max-height: 35%;
    padding: 12px;
  }

  #map {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    min-height: 150px;
    height: auto;
  }

  .close-btn {
    top: 10px;
    right: 12px;
    padding: 9px 12px;
  }
}

/* =========================================
   18. VERY SMALL PHONES
========================================= */

@media (max-width: 350px) {
  .navbar {
    padding: 9px 8px;
    gap: 6px;
  }

  .navbar h2 {
    font-size: 16px;
  }

  #clock {
    max-width: 46%;
    font-size: 11px;
  }

  .container {
    padding-right: 8px;
    padding-left: 8px;
  }

  .card {
    padding: 15px 10px;
  }

  .card-item {
    flex-basis: 52px;
    font-size: 12px;
  }
}

/* =========================================
   19. MOBILE LANDSCAPE MAP
========================================= */

@media (max-width: 768px) and (orientation: landscape) {
  .map-wrapper {
    flex-direction: row;
    padding: 12px;
  }

  .sidebar {
    flex: 0 0 190px;
    width: 190px;
    max-height: none;
  }

  #map {
    flex: 1 1 0;
    width: 0;
    height: 100%;
    min-height: 0;
  }
}

/* =========================================
   20. ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* FINAL CLOCK FIX */

.navbar {
  width: 100%;
  max-width: 100%;
  padding: 12px 15px;
  gap: 8px;
  overflow: visible;
}

.navbar h2 {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

#clock {
  display: block;
  position: relative;
  flex: 0 0 auto;

  width: auto;
  max-width: none;
  min-width: 0;

  margin: 0;
  padding: 0;

  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  text-align: right;

  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px;
    gap: 6px;
  }

  .navbar h2 {
    font-size: 16px;
  }

  #clock {
    flex: 0 1 48%;
    width: 48%;
    max-width: 48%;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 350px) {
  .navbar h2 {
    font-size: 14px;
  }

  #clock {
    flex-basis: 50%;
    width: 50%;
    max-width: 50%;
    font-size: 11px;
  }
}

/* CLOCK - DESKTOP + MOBILE FINAL OVERRIDE */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 65px;
  overflow: visible;
}

#clock {
  display: block !important;
  position: static !important;

  flex: 0 1 auto !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: 100% !important;

  height: auto !important;
  margin: 0 !important;
  padding: 5px 0 !important;

  color: #ffffff !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  text-align: right !important;

  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

@media (max-width: 480px) {
  .navbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px;
  }

  .navbar h2 {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
  }

  #clock {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 55% !important;
    font-size: 12px !important;
    text-align: right !important;
    overflow-wrap: anywhere !important;
  }
}
