/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 900px;
  height: 95vh;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

/* Header Styles */
.app-header {
  text-align: center;
  margin-bottom: 30px;
}

.app-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: #e2e8f0;
}

.app-header h1 i {
  color: #3b82f6;
}

.subtitle {
  font-size: 1.1rem;
  color: #94a3b8;
  font-weight: 300;
}

/* Card Styles */
.converter-card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(59, 130, 246, 0.1),
    0 0 30px rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
}

.converter-card:hover {
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(59, 130, 246, 0.2),
    0 0 40px rgba(59, 130, 246, 0.2);
}

/* Mode Display */
.mode-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 15px;
  padding: 20px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.mode-box {
  flex: 1;
  text-align: center;
  padding: 15px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.from-mode {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.to-mode {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mode-label {
  display: block;
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mode-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: #e2e8f0;
}

.swap-container {
  padding: 0 20px;
}

.swap-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.swap-btn:hover {
  transform: rotate(180deg) scale(1.05);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.6);
}

.swap-btn:active {
  transform: rotate(180deg) scale(0.95);
}

/* Input Section */
.input-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.input-group {
  flex: 1;
  min-width: 280px;
}

.input-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  font-size: 1.1rem;
}

.input-container {
  position: relative;
}

.input-container input {
  width: 100%;
  padding: 18px 60px 18px 20px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 2px solid rgba(59, 130, 246, 0.3);
  color: #f8fafc;
  font-size: 1.2rem;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s ease;
}

.input-container input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-container input::placeholder {
  color: #64748b;
}

.input-container input:read-only {
  background: rgba(15, 23, 42, 0.7);
  cursor: default;
}

.input-hint {
  display: block;
  font-size: 0.85rem;
  margin-top: 8px;
  opacity: 0.8;
}

.conversion-arrow {
  font-size: 2.5rem;
  color: #f8fafc;
  padding: 0 20px;
}

/* Button Styles */
.clear-btn,
.copy-btn {
  position: absolute;
  right: 15px;
  top: 35%;
  transform: translateY(-50%);
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.clear-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.clear-btn:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-50%) scale(1.05);
}

.clear-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.copy-btn {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #94a3b8;
}

.copy-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  transform: translateY(-50%) scale(1.05);
}

.copy-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.copy-btn.success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
}

/* AM/PM Toggle */
.ampm-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(59, 130, 246, 0.1);
  margin-bottom: 25px;
}

.ampm-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: #cbd5e1;
}

#ampm-indicator {
  color: #3b82f6;
  font-weight: 600;
  margin-left: 5px;
}

.toggle-switch {
  position: relative;
  width: 140px;
  height: 48px;
}

.toggle-input {
  display: none;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 24px;
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 40px;
  width: 40px;
  left: 4px;
  bottom: 4px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 50%;
  transition: all 0.4s ease;
  z-index: 2;
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(92px);
}

.toggle-input:checked + .toggle-slider {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
}

.toggle-am,
.toggle-pm {
  font-weight: 600;
  font-size: 1rem;
  z-index: 1;
  transition: color 0.4s ease;
}

.toggle-am {
  color: #3b82f6;
}

.toggle-pm {
  color: #10b981;
}

.toggle-input:checked + .toggle-slider .toggle-am {
  color: #94a3b8;
}

.toggle-input:not(:checked) + .toggle-slider .toggle-pm {
  color: #94a3b8;
}

/* Quick Examples */
.quick-examples {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.examples-label {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 10px;
  text-align: center;
}

.example-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.example-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.example-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.example-btn:active {
  transform: translateY(0);
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 40px;
  color: #94a3b8;
  font-size: 0.95rem;
}

.app-footer p {
  margin-bottom: 8px;
}

.keyboard-shortcuts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 5px;
}

.shortcut kbd {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-header h1 {
    font-size: 2rem;
  }

  .converter-card {
    padding: 20px;
  }

  .mode-display {
    flex-direction: column;
    gap: 20px;
  }

  .swap-container {
    order: -1;
    padding: 10px 0;
  }

  .mode-box {
    width: 100%;
  }

  .conversion-arrow {
    font-size: 2rem;
    padding: 10px;
  }

  .keyboard-shortcuts {
    flex-direction: column;
    gap: 10px;
  }

  .toggle-input:checked + .toggle-slider:before {
    transform: translateX(76px);
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .app-header h1 {
    font-size: 1.7rem;
    flex-direction: column;
    gap: 10px;
  }

  .converter-card {
    padding: 15px;
  }

  .swap-btn {
    width: 50px;
    height: 50px;
  }

  .toggle-switch {
    width: 120px;
    height: 44px;
  }

  .toggle-input:checked + .toggle-slider:before {
    transform: translateX(76px);
  }

  .input-group {
    min-width: 100%;
  }

  .input-section {
    flex-direction: column;
  }

  .conversion-arrow {
    transform: rotate(90deg);
    padding: 10px 0;
  }
}
