/* =====================================================
   ROUTINESUM - Premium Design System
   A refined, aesthetic, and engaging experience
   ===================================================== */

/* -------------------- CSS Variables -------------------- */
:root {
  /* Colors - Premium Palette */
  --color-bg: #F9F7F2;
  /* Soft Cream */
  --color-bg-card: rgba(255, 255, 255, 0.85);
  /* Glassmorphism Base */
  --color-primary: #2C5F2D;
  /* Deep Forest Green */
  --color-primary-hover: #1E4620;
  --color-secondary: #97BC62;
  /* Fresh Green */
  --color-accent: #FF6F61;
  /* Vibrant Coral */
  --color-text: #2D3436;
  /* Charcoal */
  --color-text-light: #636E72;
  /* Slate */
  --color-border: rgba(44, 95, 45, 0.1);
  --color-shadow: rgba(44, 95, 45, 0.08);

  /* Typography */
  --font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  /* Modern, clean font */
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 3rem;
  --line-height: 1.6;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Effects */
  --shadow-sm: 0 2px 4px var(--color-shadow);
  --shadow-md: 0 8px 16px var(--color-shadow);
  --shadow-lg: 0 16px 32px var(--color-shadow), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  --backdrop-blur: blur(12px);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(151, 188, 98, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 111, 97, 0.05) 0%, transparent 40%);
  color: var(--color-text);
  line-height: var(--line-height);
  min-height: 100vh;
  overflow-x: hidden;
}

/* -------------------- Typography -------------------- */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

p {
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-light);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-accent {
  color: var(--color-accent);
  font-weight: 600;
}

/* -------------------- Layout -------------------- */
.container {
  width: 100%;
  max-width: 800px;
  /* Slightly wider for modern feel */
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.page {
  padding: var(--space-xl) 0 var(--space-3xl);
  opacity: 0;
  animation: pageFadeIn 0.8s ease forwards;
}

@keyframes pageFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }

  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* -------------------- Glass Cards -------------------- */
.card {
  background: var(--color-bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: var(--space-xl);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px var(--color-shadow);
}

.card-header {
  margin-bottom: var(--space-lg);
}

.card-title {
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  font-weight: 500;
}

/* -------------------- Form Elements -------------------- */
.form-group {
  margin-bottom: var(--space-xl);
}

.form-label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-text);
  font-size: var(--font-size-lg);
}

.form-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-top: var(--space-xs);
  font-style: italic;
}

/* Modern Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 12px;
  background: #E0E7DE;
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  overflow: visible;
  transition: background 0.2s;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  border: 4px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--color-primary-hover);
}

.slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  border: 4px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.slider-value {
  min-width: 80px;
  text-align: center;
  font-weight: 700;
  color: #fff;
  background: var(--color-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-sm);
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-xl);
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(44, 95, 45, 0.3);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(44, 95, 45, 0.4);
}

.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 2px solid var(--color-border);
}

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

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

.btn-lg {
  padding: 1.25rem 2.5rem;
  font-size: var(--font-size-lg);
  width: 100%;
}

/* -------------------- Results Section -------------------- */
.results {
  display: none;
  margin-top: var(--space-xl);
  border-top: 2px dashed var(--color-border);
  padding-top: var(--space-xl);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.results.show {
  display: block;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-main {
  text-align: center;
  padding: var(--space-xl);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.result-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.result-number {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.result-label {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.result-comparisons {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.comparison-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.comparison-item:hover {
  transform: scale(1.02);
}

.comparison-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border-radius: 50%;
}

.comparison-text {
  flex: 1;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
}

/* -------------------- Share Buttons -------------------- */
.share-section {
  display: none;
  margin-top: var(--space-xl);
  text-align: center;
  background: var(--color-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
}

.share-section.show {
  display: block;
}

.share-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
  color: var(--color-text-light);
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.share-btn-x {
  background: #000;
  color: #fff;
}

.share-btn-x:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.share-btn-whatsapp {
  background: #25D366;
  color: #fff;
}

.share-btn-whatsapp:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

/* -------------------- Ads Placeholder -------------------- */
.ad-slot {
  width: 100%;
  margin: var(--space-xl) auto;
  text-align: center;
  display: none;
  /* Initially hidden as requested */
}

/* Use this class to debug/visualize where ads will be */
.ad-debug {
  display: block !important;
  background: rgba(0, 0, 0, 0.05);
  border: 2px dashed #ccc;
  padding: 20px;
  color: #999;
  font-weight: bold;
}

/* -------------------- Header -------------------- */
.site-header {
  padding: var(--space-md) 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.pills-link {
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-decoration: none;
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  transition: all 0.2s ease;
}

.pills-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-bg);
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  letter-spacing: -0.5px;
}

.site-logo span {
  font-size: 1.5rem;
}

/* -------------------- Footer -------------------- */
.site-footer {
  padding: var(--space-2xl) 0;
  text-align: center;
  background: #fff;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* -------------------- Responsive -------------------- */
@media (max-width: 640px) {
  :root {
    --font-size-3xl: 2.25rem;
    --font-size-2xl: 1.75rem;
    --space-xl: 1.5rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .card {
    padding: var(--space-lg);
  }

  .result-comparisons {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   Homepage Scalability (Grid & Filters)
   ========================================= */

/* Search Input */
.search-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  font-family: inherit;
  font-size: 1rem;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  text-align: center;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.filter-btn {
  background: white;
  border: 1px solid var(--color-border);
  padding: 8px 20px;
  border-radius: 50px;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--color-bg);
  transform: translateY(-1px);
  color: var(--color-text);
}

.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 10px rgba(143, 185, 150, 0.4);
}

/* Responsive Symmetrical Grid Layout */
.calculators {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  /* Force all cards in a row to match height */
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* Width Spanning only (Height remains symmetrical) */
.bento-wide {
  grid-column: span 2;
}

/* Desktop Hover Interaction */
.calculator-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(44, 95, 45, 0.12);
}

/* Tablet: 2 Columns */
@media (max-width: 1024px) {
  .calculators {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile: Single Column (Strict Reset) */
@media (max-width: 768px) {
  .calculators {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
  }

  .bento-wide {
    grid-column: span 1 !important;
  }

  .calculator-card {
    height: auto !important;
  }
}

/* =========================================
   Homepage Specific Styles
   ========================================= */

/* Lucide Icons Global Styling */
[data-lucide] {
  width: 28px;
  height: 28px;
  stroke: var(--color-primary);
  stroke-width: 1.75;
  fill: none;
}

.logo-icon {
  width: 24px;
  height: 24px;
}

/* Hero Section */
.hero-headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-lg);
  line-height: 1.15;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
  color: var(--color-text-light);
}

.hero-cta {
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.3);
  }

  50% {
    box-shadow: 0 4px 25px rgba(44, 95, 45, 0.5);
  }
}

/* Section Headers */
.section-title {
  text-align: center;
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
}

.section-sub {
  text-align: center;
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-lg);
}

/* Featured Section */
.featured-section {
  margin-top: var(--space-xl);
}

/* Calculator Card Enhancements */
.calculator-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.calculator-card .card-title {
  font-size: 1.4rem;
  margin-bottom: var(--space-xs);
}

.calculator-card .card-subtitle {
  flex: 1;
  margin-bottom: var(--space-lg);
  color: var(--color-text-light);
}

.btn-block {
  width: 100%;
  margin-top: auto;
}

/* Badges */
.badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-popular {
  background: var(--color-secondary);
  color: white;
}

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

.badge-soon {
  background: #f0f0f0;
  color: #888;
}

/* Coming Soon Cards */
.card-soon {
  opacity: 0.7;
}

.card-soon:hover {
  transform: none;
  box-shadow: var(--shadow-lg);
}

.btn-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

/* Categories Section */
.categories-section {
  margin-top: var(--space-3xl);
  padding: var(--space-2xl) 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.category-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.category-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.category-card h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  font-size: 1.25rem;
}

.category-card p {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  margin: 0;
}

/* Popular Section */
.popular-section {
  margin-top: var(--space-3xl);
}

.popular-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.popular-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: white;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.popular-card:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-md);
}

.popular-icon {
  font-size: 2rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.popular-content h3 {
  color: var(--color-text);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.popular-badge {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* Trust Section - Minimal */
.trust-section {
  margin-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  text-align: center;
}

.trust-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin: 0;
}

/* Footer Enhancements */
.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.footer-link {
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-link:hover,
.footer-link.active {
  color: var(--color-primary);
}

.footer-tagline {
  color: var(--color-text);
  font-weight: 600;
  margin: 0;
}

/* Mobile Adjustments for Homepage */
@media (max-width: 640px) {
  .hero-headline {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .popular-card {
    padding: var(--space-md);
  }

  .trust-box {
    flex-direction: column;
    text-align: center;
  }
}