/* ============================================================
   Λογάριασε — Shared Stylesheet
   ============================================================ */

:root {
  --navy: #1B2A4A;
  --orange: #F97316;
  --orange-hover: #EA6C0A;
  --orange-light: #FFF8F3;
  --warm-white: #FAFAF8;
  --card-bg: #FFFFFF;
  --border: #E8E8E4;
  --text-primary: #1B2A4A;
  --text-body: #374151;
  --text-label: #6B7280;
  --text-muted: #9CA3AF;
  --success: #059669;
  --error: #DC2626;
  --sidebar-text: #E8EDF5;
  --sidebar-muted: rgba(232,237,245,0.55);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--warm-white);
  color: var(--text-body);
  line-height: 1.6;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 220px;
  height: 100vh;
  background: var(--navy);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.sidebar-logo {
  font-size: 22px;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
  display: block;
}
.sidebar-logo:hover { opacity: 0.9; }
.sidebar-tagline { font-size: 11px; color: var(--sidebar-muted); margin-top: 2px; }
.sidebar-search {
  height: 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: white;
  font-size: 13px;
  padding: 0 10px;
  width: 100%;
  margin-top: 1.25rem;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.sidebar-search::placeholder { color: var(--sidebar-muted); }
.sidebar-search:focus { border-color: var(--orange); }
.sidebar-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}
.sidebar-link {
  font-size: 13px;
  color: var(--sidebar-text);
  padding: 6px 10px;
  border-radius: 6px;
  display: block;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.07); }
.sidebar-link.active {
  color: var(--orange);
  border-left: 3px solid var(--orange);
  padding-left: 7px;
  font-weight: 500;
}
.sidebar-link.dimmed {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.soon-badge {
  font-size: 9px;
  color: var(--sidebar-muted);
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}
.recent-section { margin-top: 1rem; }
.recent-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.no-results-msg { font-size: 12px; color: var(--sidebar-muted); padding: 6px 10px; display: none; }

/* ---- Main Content ---- */
.main-content {
  margin-left: 220px;
  max-width: 820px;
  margin-right: auto;
  padding: 2rem 2.5rem;
}
@media (min-width: 769px) {
  .main-content {
    margin-left: 220px;
    margin-right: auto;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    max-width: calc(220px + 820px + 2.5rem);
  }
}

/* ---- Hero Banner ---- */
.hero {
  background: linear-gradient(135deg, #1B2A4A 0%, #2D3F63 100%);
  padding: 2.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}
.hero-title { font-size: 26px; font-weight: 600; color: white; margin: 0; line-height: 1.3; }
.hero-subtitle { font-size: 15px; color: rgba(255,255,255,0.75); margin-top: 0.5rem; margin-bottom: 0; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.25rem; }
.hero-pill {
  font-size: 12px;
  color: var(--orange);
  border: 1px solid var(--orange);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ---- Breadcrumbs ---- */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--text-label);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb .sep { margin: 0 6px; }

/* ---- Calculator Cards ---- */
.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 1.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: relative;
}
.calc-card.flagship { border: 2px solid var(--orange); }
.flagship-badge {
  position: absolute;
  top: 16px; right: 16px;
  background: linear-gradient(135deg, #F97316, #F59E0B);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

/* Category pills */
.cat-pill {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 20px;
  vertical-align: middle;
}
.cat-auto { background: #FEF3C7; color: #92400E; }
.cat-health { background: #D1FAE5; color: #065F46; }
.cat-bank { background: #DBEAFE; color: #1E40AF; }
.cat-home { background: #FCE7F3; color: #831843; }
.cat-dates { background: #F3F4F6; color: #374151; }
.cat-lifestyle { background: #EDE9FE; color: #5B21B6; }

.calc-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin: 0.5rem 0 0.35rem;
}
.calc-desc {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.calc-card hr { border: none; border-top: 1px solid var(--border); margin-bottom: 0; }

/* ---- Input Grid ---- */
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-label);
  margin-bottom: 5px;
}
.input-group input,
.input-group select {
  width: 100%;
  height: 44px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  color: var(--text-primary);
  background: white;
  font-family: 'Inter', sans-serif;
  transition: border-color 150ms;
}
.input-group input:focus,
.input-group select:focus {
  border-color: var(--orange);
  outline: 3px solid rgba(249,115,22,0.15);
  outline-offset: 0;
}
.input-group input.input-error,
.input-group select.input-error { border-color: var(--error); }
.error-msg { font-size: 12px; color: var(--error); margin-top: 4px; display: none; }
.group-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  grid-column: 1 / -1;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.25rem;
}
.checkbox-group input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--orange);
}
.checkbox-group label { font-size: 14px; color: var(--text-body); margin-bottom: 0; }

/* ---- Buttons ---- */
.btn-primary {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 8px;
  height: 44px;
  padding: 0 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.25rem;
  font-family: 'Inter', sans-serif;
  transition: background 150ms;
}
.btn-primary:hover { background: var(--orange-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-full { width: 100%; }

/* ---- Result Panel ---- */
.result-panel {
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin-top: 1.25rem;
  display: none;
  position: relative;
}
.result-panel.visible {
  display: block;
  animation: fadeSlideIn 220ms ease-out;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
}
.result-row + .result-row { border-top: 1px solid rgba(249,115,22,0.15); }
.result-label { font-size: 13px; color: var(--text-label); }
.result-value { font-size: 18px; font-weight: 600; color: var(--navy); }
.result-value.highlight { font-size: 28px; font-weight: 700; color: var(--orange); }
.result-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; font-style: italic; }
.btn-print {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 12px;
  color: var(--text-label);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-print:hover { color: var(--orange); }

/* ---- BMI Scale ---- */
.bmi-scale {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #3B82F6 0%, #22C55E 25%, #EAB308 50%, #F97316 65%, #EF4444 80%, #991B1B 100%);
  position: relative;
  margin: 16px 0 8px;
}
.bmi-marker {
  position: absolute;
  top: -6px;
  width: 4px; height: 24px;
  background: var(--navy);
  border-radius: 2px;
  transition: left 0.3s;
}
.bmi-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}
.bmi-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
}

/* ---- Stacked Bar Chart ---- */
.stacked-bar-container { margin-top: 1rem; }
.stacked-bar {
  display: flex;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.stacked-bar div { height: 100%; transition: width 0.3s; }
.bar-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.bar-legend-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-label); }
.bar-legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* ---- Amortization Table ---- */
.amort-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.amort-table th { background: rgba(249,115,22,0.1); color: var(--navy); font-weight: 600; padding: 8px 10px; text-align: left; }
.amort-table td { padding: 6px 10px; border-bottom: 1px solid rgba(249,115,22,0.1); color: var(--text-body); }
.amort-toggle { font-size: 13px; color: var(--orange); background: none; border: none; cursor: pointer; margin-top: 8px; font-weight: 500; font-family: 'Inter', sans-serif; }

/* ---- Depreciation Table ---- */
.depr-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.depr-table th { background: rgba(249,115,22,0.1); color: var(--navy); font-weight: 600; padding: 8px 10px; text-align: left; }
.depr-table td { padding: 6px 10px; border-bottom: 1px solid rgba(249,115,22,0.1); color: var(--text-body); }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: opacity 0.2s;
}
.back-to-top.visible { display: flex; }

/* ---- Footer ---- */
.site-footer {
  background: #1B2A4A;
  color: rgba(232,237,245,0.7);
  padding: 2rem;
  text-align: center;
  font-size: 13px;
  margin-left: 220px;
}
.site-footer a { color: rgba(232,237,245,0.7); text-decoration: none; margin: 0 8px; }
.site-footer a:hover { color: var(--orange); }

/* ---- Mobile Top Bar ---- */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  height: 56px;
  background: var(--navy);
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 110;
}
.mobile-topbar .sidebar-logo { font-size: 20px; }
.hamburger {
  background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 4px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-close {
  display: none;
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none; color: var(--sidebar-muted); font-size: 20px; cursor: pointer;
}

/* ---- Homepage Grid Cards ---- */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.calc-grid-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  display: block;
}
.calc-grid-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.calc-grid-card.flagship-card { border: 2px solid var(--orange); }
.calc-grid-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin: 8px 0 6px;
}
.calc-grid-card p {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0;
}
.calc-grid-card .card-arrow {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--orange);
  font-weight: 500;
}
.category-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Related Calculators ---- */
.related-section { margin-top: 2rem; }
.related-section h2 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-label);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.related-card {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
  display: block;
}
.related-card:hover { border-color: var(--text-muted); }
.related-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin: 6px 0 4px;
}
.related-card p {
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.4;
  margin: 0;
}
.related-card .card-arrow {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--orange);
  font-weight: 500;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px; z-index: 120; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.visible { display: block; }
  .mobile-topbar { display: flex; }
  .main-content { margin-left: 0 !important; padding: 1rem; max-width: 100%; }
  .hero { padding: 1.5rem; }
  .hero-title { font-size: 22px; }
  .input-grid { grid-template-columns: 1fr; }
  .btn-primary { width: 100%; }
  .result-value.highlight { font-size: 24px; }
  .site-footer { margin-left: 0; }
  .hero-pills { gap: 6px; }
  .hero-pill { font-size: 11px; padding: 3px 8px; }
  .calc-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .mobile-topbar, .back-to-top, .btn-primary, .btn-print, .site-footer, .breadcrumb, .related-section { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0; }
  .calc-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
