/* Online Clock Now - Clean, modern styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header / Clock area */
.hero {
  background: var(--gradient);
  color: white;
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  position: relative;
}

.clock-display {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}

.date-display {
  font-size: 1.15rem;
  opacity: 0.95;
  margin-bottom: 0.15rem;
}

.location-display {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-speak {
  background: rgba(255,255,255,0.2);
  color: white;
  backdrop-filter: blur(4px);
}

.btn-speak:hover {
  background: rgba(255,255,255,0.3);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

/* Language switcher */
.lang-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lang-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.lang-btn:hover:not(.active) {
  background: #f1f5f9;
  color: var(--text);
}

/* Navigation tabs */
.nav-tabs {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-tab {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-tab.active {
  background: var(--primary);
  color: white;
}

.nav-tab:hover:not(.active) {
  background: #f1f5f9;
  color: var(--text);
}

/* Main content */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.tool-panel {
  display: none;
  background: var(--card);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.tool-panel.active {
  display: block;
}

.tool-panel h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.tool-panel .desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

/* World clock list */
.city-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.city-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.city-name {
  font-weight: 600;
}

.city-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.city-time {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

/* Stopwatch / Timer displays */
.big-time {
  font-size: 3.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  margin: 1rem 0 1.5rem;
  letter-spacing: 0.02em;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.laps {
  margin-top: 1.25rem;
  max-height: 200px;
  overflow-y: auto;
}

.lap-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

/* Alarm */
.alarm-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.alarm-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.alarm-form input, .alarm-form select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
}

.alarm-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alarm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

/* Calendar */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}

.cal-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0;
}

.cal-day {
  padding: 0.6rem 0;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.cal-day.today {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.cal-day.other {
  color: #cbd5e1;
}

/* Sunrise */
.sun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sun-card {
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 1.1rem;
  text-align: center;
  border: 1px solid var(--border);
}

.sun-card .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.sun-card .value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
}

/* Favorites */
.fav-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.fav-form input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
}

/* Content sections (for AdSense value) */
.content-section {
  background: var(--card);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.content-section h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #dbeafe;
}

.content-section h3 {
  font-size: 1.15rem;
  margin: 1.4rem 0 0.6rem;
  color: var(--text);
}

.content-section p {
  margin-bottom: 0.9rem;
  color: #334155;
}

.content-section ul, .content-section ol {
  margin: 0.6rem 0 1rem 1.4rem;
}

.content-section li {
  margin-bottom: 0.4rem;
}

.content-section a {
  color: var(--primary);
  text-decoration: none;
}

.content-section a:hover {
  text-decoration: underline;
}

/* FAQ */
.faq-item {
  margin-bottom: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-item h4 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

/* Footer */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-inner h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
}

.footer-inner a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.footer-inner a:hover {
  color: white;
}

.footer-bottom {
  max-width: 900px;
  margin: 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid #1e293b;
  text-align: center;
  font-size: 0.85rem;
}

/* Page-specific (About, Privacy, etc.) */
.page-header {
  background: var(--gradient);
  color: white;
  padding: 2.5rem 1rem;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.page-content h2 {
  font-size: 1.35rem;
  color: var(--primary);
  margin: 1.75rem 0 0.7rem;
}

.page-content p, .page-content li {
  margin-bottom: 0.85rem;
  color: #334155;
}

.page-content ul {
  margin-left: 1.3rem;
  margin-bottom: 1rem;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
}

.contact-form label {
  font-weight: 500;
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* Ad placeholder */
.ad-slot {
  text-align: center;
  padding: 1rem;
  margin: 1rem 0;
  background: #f1f5f9;
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 600px) {
  .big-time {
    font-size: 2.4rem;
  }
  .city-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  .nav-tabs {
    gap: 0.25rem;
  }
  .nav-tab {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* RTL support for Arabic */
[dir="rtl"] .city-item,
[dir="rtl"] .alarm-item,
[dir="rtl"] .lap-item {
  flex-direction: row-reverse;
}