/** Custom Styling **/

.clock-card {
  text-align: center;
  position: relative;
}

.clock-time {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 10px;
}

.clock-date {
  font-size: 0.9rem;
  color: #666;
}

canvas {
  display: block;
  margin: 0 auto;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, .4);
}

.remove-clock {
  position: absolute;
  top: 10px;
  right: 10px;
}

img.emoji {
  height: 1em;
  /* same height as text */
  width: 1.2em;
  /* a little wider for flags */
  vertical-align: -0.2em;
  /* align nicely with baseline */
}

.show-info {
  font-size: 0.85rem;
  color: #007bff;
  cursor: pointer;
  display: inline-block;
  margin-top: 5px;
}

.show-info:hover {
  text-decoration: underline;
}

.clock-info {
  font-size: 0.8rem;
  color: #444;
  margin-top: 5px;
  display: none;
  /* hidden until clicked */
}

.clock-info table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 5px;
}

.clock-info th,
.clock-info td {
  text-align: left;
  padding: 2px 6px;
  border-bottom: 1px solid #eee;
}

.clock-info th {
  font-weight: bold;
  color: #333;
  width: 40%;
}

.earth-mask {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset -10px 0 20px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 200, 255, 0.4);
  position: relative;
}

.earth-icon {
  width: 240px;
  /* 2x width of mask for correct aspect ratio */
  height: 120px;
  /* keep 2:1 aspect ratio */
  background-image: url("../images/960px-Equirectangular-projection.jpg");
  background-repeat: repeat-x;
  background-size: 240px 120px;
  background-position-x: 0;
  transition: background-position-x 2s ease-out;
}

.earth-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

@keyframes slideEarth {
  from {
    background-position-x: 0;
  }

  to {
    background-position-x: var(--target-shift);
  }
}

.animate {
  animation: slideEarth 2s ease-out forwards;
}

/* Make the nav clock input & button match the height of the other nav buttons */
.navbar .form-control,
.navbar .btn {
  /* Use the same height basis for both input & buttons */
  height: calc(1.5em + .75rem + 2px);
  /* typical Bootstrap .btn height */
}

/* Ensure the Add Clock button text sits well inside */
#add-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 .75rem;
}

/* Optional: limit width of the input so it doesn't stretch too much */
#city-input {
  width: 300px;
}

/* Ensure vertical alignment of form & buttons in collapse container */
.navbar .collapse .d-flex,
.navbar .collapse form.d-flex {
  align-items: center;
}

/* Header with full-width ad below or behind */
.header-with-ad .container-fluid {
  display: flex;
  align-items: center;
  padding: 0;
  /* remove extra padding if needed */
}

.header-with-ad .navbar-brand {
  margin-right: 16px;
  z-index: 2;
  /* above ad */
}

.ad-holder {
  position: relative;
  flex: 1 1 auto;
  /* optionally: set a min-height to match buttons or ad */
  padding: 8px 0;
}

/* Center the ad content within ad-holder */
.ad-holder .ad-content {
  margin: 0 auto;
  z-index: 1;
}

/* Position login/signup to the right inside ad-holder */
.ad-holder .ad-buttons {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 16px;
  z-index: 2;
}

/* Make sure buttons are visible above ad background */
.ad-buttons .btn {
  vertical-align: middle;
  margin: 0;
}

/* If you want the ad-holder background color across the full header area */
.header-with-ad {
  /* background-color: #f8f9fa; */
  max-width:90%;
  margin:0 auto;
  /* or whatever your ad background */
}
input[list] {
  width: 240px; /* ensure input width */
}

/* Some vendor shadow styling (not guaranteed) */
datalist {
  width: 100%;  
}

/* Wrapper / container for each clock card */
.clock-item {
  transition: all 0.3s ease;
}

/* Default / medium size */
.clock-item.medium {
  flex: 0 0 25%;
  max-width: 25%;
}
.clock-item.medium .clock-card {
  padding: 12px;
  font-size: 1rem;
}

/* Small: more per row */
.clock-item.small {
  flex: 0 0 20%;
  max-width: 20%;
}
.clock-item.small .clock-card {
  padding: 8px;
  font-size: 0.85rem;
}

/* Large: fewer per row */
.clock-item.large {
  flex: 0 0 33.3333%;
  max-width: 33.3333%;
}
.clock-item.large .clock-card {
  padding: 16px;
  font-size: 1.2rem;
}
.world-time-info {
  max-width: 90%;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  color: #1d1d1d;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.65;
  margin: 3rem auto;
}

.content-wrapper {
  padding: 3rem 3.5rem;
}

.world-time-info h2 {
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  color: #0056b3;
}

.world-time-info h3 {
  font-size: 1.25rem;
  color: #002d72;
}

.world-time-info p, .world-time-info .lead {
  font-size: 1.125rem;
  color: #3b3b3b;
}

.world-time-info .lead {
  font-weight: 500;
  line-height: 1.7;
}

@media (max-width: 1199px) {
  .world-time-info {
    max-width: 90%;
  }
  .content-wrapper {
    padding: 2rem 1.75rem;
  }
  .world-time-info h2 {
    font-size: 1.75rem;
  }
  .world-time-info h3 {
    font-size: 1.1rem;
  }
  .world-time-info p, .world-time-info .lead {
    font-size: 1rem;
  }
}

@media (min-width: 1400px){
	.container{
        max-width: 90%;
		padding: 0px;
    }
	.world-time-info {
		max-width: 90%;
		padding: 0px;
	}
}

.world-time-info .lead {
  font-weight: 500;
  line-height: 1.7;
}

/* ===== 📱 Mobile Responsive Fixes ===== */
@media (max-width: 768px) {
  /* Make clock cards take full width on mobile */
  .clock-item {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .clock-card {
    margin-bottom: 1rem;
    padding: 1rem;
  }

  /* Center clock elements */
  .clock-card h5 {
    font-size: 1.1rem;
    word-break: break-word;
  }

  canvas {
    width: 140px !important;
    height: 140px !important;
  }

  .clock-time {
    font-size: 1.25rem;
  }

  .clock-date {
    font-size: 0.85rem;
  }

  /* Adjust top controls layout */
  .d-inline-flex.align-items-center.gap-3 {
    flex-direction: column;
    gap: 10px;
  }

  /* Fix input width on small devices */
  #city-input {
    width: 100% !important;
    max-width: 100% !important;
  }

  .input-group {
    width: 100% !important;
  }
}
#clocks-row {
  row-gap: 1.5rem;
}

/* ===== 📱 Fix Filter Section (Mobile Responsive) ===== */
@media (max-width: 768px) {
  /* Stack elements vertically */
  .d-inline-flex.align-items-center.gap-3 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    width: 100%;
  }

  /* Make toggle and label appear inline and centered */
  .form-check.form-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .form-check-label {
    margin-left: 0.5rem;
    font-size: 1rem;
  }

  /* Make search bar and button full width */
  .input-group {
    width: 100% !important;
    display: flex;
  }

  #city-input {
    flex: 1;
    width: 100% !important;
  }

  #add-clock {
    white-space: nowrap;
  }

  /* Stack the clock size options neatly */
  #clock-size-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  #clock-size-filter label {
    margin-bottom: 4px;
    font-weight: 600;
  }

  .form-check-inline {
    margin: 0 6px;
  }
}

.navbar-brand {
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}

.dropdown-menu a:hover {
  background-color: #343a40;
  color: #fff !important;
}
 

.navbar .nav-link {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.dropdown-menu a:hover {
  background-color: #343a40;
  color: #fff !important;
}


.navbar {
  font-size: 0.9rem;
  line-height: 1.2;
  min-height: 38px; /* slightly reduced height */
  padding-top: 0.2rem !important;
  padding-bottom: 0.2rem !important;
  /* border-radius: 8px; */
}

.navbar .nav-link {
  padding: 0.3rem 0.75rem;
}

.dropdown-menu a:hover {
  background-color: #343a40;
  color: #fff !important;
}

/* Center the navbar horizontally */
nav.navbar {
  max-width: 960px;          /* same as main container */
  margin: 0 auto;            /* center horizontally */
}


/* --- Modern Dropdown Styling --- */
.modern-dropdown {
   
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin-top: 0.25rem !important;
  min-width: 8rem;
  animation: fadeIn 0.2s ease-out;
}

/* Dropdown item look */
.modern-dropdown .dropdown-item {
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Hover effect */
.modern-dropdown .dropdown-item:hover {
  background-color: #0d6efd;
  color: #fff;
  transform: translateX(3px);
}

/* Smooth fade animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Navbar compactness */
.navbar {
  font-size: 0.9rem;
  min-height: 36px;
  padding-top: 0.1rem !important;
  padding-bottom: 0.1rem !important;
   
}

.navbar .nav-link {
  padding: 0.35rem 0.75rem;
  color: #fff !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #0d6efd !important;
}

/* Ensure dropdown aligns nicely below the text */
.nav-item.dropdown .dropdown-menu {
  top: 100%;
  right: 0;
  left: auto;
}
/* ===== 🕓 Time Difference Section ===== */
.time-diff {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  color: #000; /* text color black */
  font-weight: 500;
}

.time-diff.ahead {
  background-color: #E9FCF0; /* green */
}

.time-diff.behind {
  background-color: #FCE9E9; /* matching red tone */
}
