:root {
  --bg-start: #0f172a;
  --bg-mid: #1e293b;
  --bg-end: #0f172a;
  --card: rgba(30, 41, 59, 0.7);
  --card-hover: rgba(30, 41, 59, 0.9);
  --border: rgba(148, 163, 184, 0.1);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --success: #10b981;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --radius: 1.5rem;
  --radius-sm: 0.75rem;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top left, #312e81, transparent 40%),
              radial-gradient(circle at bottom right, #1e1b4b, transparent 40%),
              var(--bg-start);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.header {
  text-align: center;
  padding: 1rem 0 3rem;
}

.header h1 {
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.tool-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeIn 0.8s ease-out;
}

.tool-title-section h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.tool-title-section p {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.calculator-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.input-section, .results-section {
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.input-section:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 40px -10px rgba(139, 92, 246, 0.15);
}

.birth-input h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.quick-date-section {
  margin-bottom: 2rem;
}

.quick-date-section h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.quick-date-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quick-date-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.quick-date-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.method-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
}

.method-tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  border-radius: 0.75rem;
  transition: var(--transition);
}

.method-tab.active {
  background: var(--card-hover);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.input-group {
  margin-bottom: 1.5rem;
}

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

.form-input {
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.results-container h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-card.primary {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
  border-color: rgba(139, 92, 246, 0.3);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.fun-facts {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.fun-facts h4 {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.fact-list {
  display: grid;
  gap: 1rem;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}

.fact-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--accent);
}

.usage-guide {
  margin-top: 3rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
}

.guide-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.guide-section h4 {
  color: var(--text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-list {
  list-style: none;
  color: var(--text-muted);
}

.guide-list li {
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  position: relative;
}

.guide-list li::before {
  content: "•";
  color: var(--accent);
  position: absolute;
  left: 0;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .tool-title-section h1 {
    font-size: 2.5rem;
  }
  
  .input-section, .results-section {
    padding: 1.5rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
}

/* Share section */
.share-section {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-share, .btn-copy {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-share {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border: none;
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-copy {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-copy:hover {
  background: var(--border);
}

/* Toast notification */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--background);
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Improve stat cards animation */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Real-time seconds pulse */
#seconds-alive {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
