/* World Clock — page specific overrides (uses variables from main.css) */
.tool-container { padding: 80px 0; min-height: calc(100vh - 200px); }
.tool-header { text-align:center; margin-bottom: 40px; }
.tool-header h1 { font-size: 2.2rem; margin-bottom: 8px; color: var(--text); }
.tool-header p { color: var(--text-light); }

.world-clock-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 60px;
}

/* Search Section */
.search-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.search-container {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  position: relative;
  min-width: 300px;
}

.search-input input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
}

.search-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.search-input i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: var(--transition);
}

.search-result-item:hover {
  background: #f8fafc;
}

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

.format-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Main Clock Section */
.main-clock-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.main-clock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(227, 6, 19, 0.2);
}

.main-clock-title h2 {
  margin-bottom: 5px;
  font-size: 1.5rem;
}

.main-clock-title span {
  color: var(--text-light);
  font-size: 0.9rem;
}

.clock-toggle {
  display: flex;
  gap: 5px;
  background: #f1f5f9;
  border-radius: var(--radius);
  padding: 4px;
}

.clock-toggle button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.clock-toggle button.active {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-clock-content {
  position: relative;
}

.digital-clock {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary);
}

.clock-date {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.analog-clock {
  width: 200px;
  height: 200px;
  border: 8px solid var(--text);
  border-radius: 50%;
  margin: 0 auto 20px;
  position: relative;
  display: none;
  background: #f8fafc;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

/* Analog clock numbers */
.clock-number {
  position: absolute;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transform-origin: center;
}

.analog-clock .hand {
  position: absolute;
  transform-origin: bottom center;
  bottom: 50%;
  left: 50%;
  border-radius: 4px;
  transform: translateX(-50%);
}

.hour-hand {
  width: 6px;
  height: 50px;
  background: var(--text);
  margin-left: -3px;
}

.minute-hand {
  width: 4px;
  height: 70px;
  background: var(--text);
  margin-left: -2px;
}

.second-hand {
  width: 2px;
  height: 80px;
  background: var(--primary);
  margin-left: -1px;
}

.center-circle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* World Clocks Section */
.world-clocks-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(227, 6, 19, 0.2);
}

.section-header h2 {
  margin: 0;
}

.city-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.clocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.clock-card {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border-left: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.clock-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.clock-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

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

.city-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  line-height: 1.2;
}

.time-difference {
  font-size: 0.75rem;
  color: var(--text-light);
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 10px;
  align-self: flex-start;
}

.clock-actions {
  display: flex;
  gap: 4px;
}

.favorite-btn, .remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  color: var(--text-light);
  font-size: 0.9rem;
}

.favorite-btn:hover, .remove-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.favorite-btn.favorited {
  color: #fbbf24;
}

.clock-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.digital-time {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.2;
}

.clock-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.clock-date-small {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.2;
}

.day-night i {
  font-size: 1rem;
}

/* Map Section */
.map-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.map-controls {
  display: flex;
  gap: 10px;
}

.map-container {
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid #e5e7eb;
}

/* Custom red markers for the map */
.custom-red-marker {
  background-color: #e30613;
  border: 3px solid white;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Success Message */
.success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 10000;
  animation: fadeInOut 3s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-20px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

/* Tool Info */
.tool-info {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-top: 40px;
}

.tool-info h2 {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(227, 6, 19, 0.2);
}

.tool-info h3 {
  margin: 18px 0 10px;
  color: var(--primary);
}

.tool-info ul, .tool-info ol {
  margin-left: 18px;
  margin-bottom: 12px;
}

.tool-info li {
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 980px) {
  .search-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input {
    min-width: auto;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .city-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .main-clock-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .digital-clock {
    font-size: 2.5rem;
  }
  
  .clocks-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .clocks-grid {
    grid-template-columns: 1fr;
  }
  
  .city-buttons {
    flex-direction: column;
  }
  
  .city-buttons button {
    width: 100%;
  }
}