/* ==========================================================================
   Grams to Cups Converter - Modern Culinary Design System & Utilities
   ========================================================================== */

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fef3c7;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  background-color: var(--bg-main);
  color: var(--text-dark);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.01em;
}

/* Header & Navbar */
.site-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  position: sticky;
  top: 0;
  z-index: 990;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #ffffff;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 60%, #f8fafc 100%);
  color: #fff;
  padding: 48px 0 20px 0;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto 28px auto;
  line-height: 1.6;
}

/* Calculator Card */
.calculator-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 32px;
  margin-top: -30px;
  position: relative;
  z-index: 10;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 768px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.calc-swap-btn {
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 auto;
}

.calc-swap-btn:hover {
  background-color: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
  transform: rotate(180deg);
}

.calc-result-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
  border: 2px dashed #0d9488;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin: 24px 0 16px 0;
}

.calc-result-primary {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f766e;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.calc-result-fraction {
  font-size: 1.15rem;
  color: #334155;
  font-weight: 600;
}

.calc-result-details {
  font-size: 0.92rem;
  color: #64748b;
  margin-top: 8px;
}

/* Formula & Math Step Cards */
.formula-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 8px 16px;
  border-radius: 9999px;
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 700;
}

.math-step-box {
  background-color: #f8fafc;
  border-left: 4px solid #0d9488;
  padding: 16px 20px;
  border-radius: 0 10px 10px 0;
  margin: 16px 0;
}

/* Chips & Badges Grid */
.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.seo-link-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.seo-link-chip:hover {
  background-color: #f0fdfa;
  border-color: #0d9488;
  color: #0f766e;
  transform: translateY(-1px);
}

.seo-link-chip.active {
  background-color: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
}

/* Tables */
.custom-table-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.custom-table thead th {
  background-color: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.custom-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
}

.custom-table tbody tr:last-child td {
  border-bottom: none;
}

.custom-table tbody tr.highlight-row {
  background-color: #f0fdfa !important;
  font-weight: 700;
  color: #0f766e;
}

/* Search Bar */
.search-container {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 18px !important;
  border-radius: 24px !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
  font-size: 1rem !important;
}

.search-input-wrap input:focus {
  border-color: #0d9488 !important;
  box-shadow: 0 0 0 3px rgba(13,148,136,0.2) !important;
}

.search-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  margin-top: 6px;
  z-index: 100;
  max-height: 380px;
  overflow-y: auto;
  display: none;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.search-item:hover {
  background-color: #f8fafc;
  color: #0d9488;
}

/* Category Grid */
.category-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  text-align: center;
  transition: all 0.25s;
  text-decoration: none;
  display: block;
  color: #1e293b;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08);
  border-color: #0d9488;
}

.category-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: #f0fdfa;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  font-size: 26px;
}

/* Footer */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 48px 0 24px 0;
  margin-top: 64px;
}

.site-footer h5 {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.site-footer a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
  margin-bottom: 8px;
}

.site-footer a:hover {
  color: #38bdf8;
}

.footer-copyright {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  margin-top: 36px;
  font-size: 0.9rem;
}

/* Admin Dashboard & Layout */
.admin-body {
  background-color: #f1f5f9;
}

.admin-nav {
  background-color: #0f172a;
}

.admin-sidebar {
  background-color: #ffffff;
  border-right: 1px solid #e2e8f0;
  min-height: calc(100vh - 68px);
  padding: 24px 0;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.admin-sidebar-link:hover, .admin-sidebar-link.active {
  background-color: #f0fdfa;
  color: #0d9488;
  border-left: 4px solid #0d9488;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Installer Wizard */
.installer-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 24px;
}

.installer-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.installer-header {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: white;
  padding: 28px 32px;
}

.step-bullet {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 8px;
}

.step-bullet.active {
  background-color: #ffffff;
  color: #0d9488;
}

/* Breadcrumbs bar */
.breadcrumb-bar {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 0;
  margin-bottom: 24px;
}
