/* Modern Theme for Calculator Website */
/* Inspired by clean, professional design with modern typography and spacing */

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Dark mode variables */
.dark {
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;

  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #282828;

  --border-color: #333333;
}

/* Global styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all 0.3s ease;
}

.modern-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all 0.3s ease;
}

/* Typography improvements */
h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

/* Modern header */
.modern-header {
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.modern-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.modern-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}

.modern-header .logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.modern-header .nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.modern-header .nav-links a {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.modern-header .nav-links a:hover {
  color: var(--primary-color);
  background: var(--bg-tertiary);
}

.modern-header .nav-links a.active {
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}

/* Country display */
.modern-header .country-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.modern-header .country-display:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
}

.modern-header .country-flag {
  width: 1.25rem;
  height: 1rem;
  border-radius: 0.125rem;
  object-fit: cover;
}

/* Hero section */
.hero-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.hero-section .hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 2rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-section .hero-subtitle {
  font-size: 1.875rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  white-space: nowrap;
}

.hero-section .hero-tagline {
  font-size: 1.5rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.6;
  font-weight: 500;
}

/* Modern buttons */
.modern-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.modern-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.modern-button-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.modern-button-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
}

/* Category sections */
.category-section {
  padding: 5rem 0;
}

.category-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.category-section .section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.category-section .section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.category-section .section-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Modern cards */
.modern-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.modern-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modern-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(37, 99, 235, 0.2);
}

.modern-card:hover::before {
  opacity: 1;
}

.modern-card .card-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gradient-primary);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.25rem;
}

.modern-card .card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modern-card .card-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.modern-card .card-link {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.modern-card .card-link:hover {
  color: var(--primary-hover);
  gap: 0.5rem;
}

/* Clickable card styles */
.clickable-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: block;
  transition: all 0.3s ease;
}

.clickable-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(37, 99, 235, 0.3);
}

.clickable-card:hover::before {
  opacity: 1;
}

/* Calculator grid */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 3rem;
}

/* Form improvements */
.modern-form {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.modern-form .form-group {
  margin-bottom: 1.5rem;
}

.modern-form label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modern-form input,
.modern-form select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.modern-form input:focus,
.modern-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Unit selection styles */
.input-with-unit {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.input-with-unit .form-input {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-with-unit .unit-select {
  width: auto;
  min-width: 80px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
  background: var(--bg-secondary);
  font-weight: 500;
}

.input-with-unit .unit-select:focus {
  border-left: 1px solid var(--primary-color);
}

/* Results display */
.results-card {
  background: linear-gradient(135deg, var(--success-color), #34d399);
  color: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
}

.results-card .result-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.results-card .result-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

/* Footer improvements */
.modern-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
}

.modern-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

.modern-footer .footer-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.modern-footer .footer-section ul {
  list-style: none;
  padding: 0;
}

.modern-footer .footer-section ul li {
  margin-bottom: 0.5rem;
}

.modern-footer .footer-section ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.modern-footer .footer-section ul li a:hover {
  color: var(--primary-color);
}

.modern-footer .footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive design */
@media (max-width: 768px) {
  .modern-header nav {
    flex-direction: column;
    gap: 1rem;
  }

  .modern-header .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  h1 {
    font-size: 2.5rem;
  }

  .hero-section {
    padding: 3rem 0;
  }

  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .modern-card {
    padding: 0.875rem;
  }
}

/* Utility classes */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: var(--gradient-primary);
}

.shadow-modern {
  box-shadow: var(--shadow-lg);
}

/* Theme Toggle Switch */
.theme-toggle-checkbox {
  display: none;
}

.theme-toggle-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle-btn .sun-icon {
  display: block;
}

.theme-toggle-btn .moon-icon {
  display: none;
}

.theme-toggle-btn:hover {
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-sm);
}

.dark .theme-toggle-btn {
  background: #1a1a1a;
}

.dark .theme-toggle-btn .sun-icon {
  display: none;
}

.dark .theme-toggle-btn .moon-icon {
  display: block;
}

/* How to Use Section */
.how-to-use-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.how-to-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.how-to-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.how-to-step {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.how-to-step h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.how-to-step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.how-to-note {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--warning-color);
  margin-top: 0.5rem;
}

.how-to-note strong {
  color: var(--warning-color);
}