/* ==========================================================
   Sri Somasundara ARC — main.css
   Layout inspired by teenedgeacademy.org
   Colors from ssarc.com palette
   ========================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ---------- Design tokens ---------- */
:root {
  /* Background layers */
  --bg:            #f8f8c0;   /* warm pale yellow — page background  */
  --surface:       #fcfce6;   /* lighter cream — sidebar, cards       */
  --surface-hover: #f4f0b0;   /* slightly deeper for hover            */
  --active-bg:     #f0e898;   /* active nav link background           */

  /* Borders */
  --border:        #ddd080;   /* general border                       */
  --border-light:  #eee8a0;   /* subtle dividers                      */

  /* Topbar & footer */
  --topbar-bg:     #3d1a03;   /* very dark brown                      */
  --topbar-text:   #fcfce6;   /* cream on dark                        */

  /* Accent (orange) */
  --accent:        #d16d2a;   /* primary orange                       */
  --accent-dark:   #a85020;   /* hover / active border                */
  --accent-light:  #f0a060;   /* lighter orange tint                  */

  /* Text */
  --text:          #1a0a00;   /* near-black brown                     */
  --text-muted:    #5e2906;   /* medium brown — sidebar body text     */
  --text-light:    #8a5030;   /* lighter brown — meta / captions      */

  /* Green accent for "auspicious" highlights */
  --green:         #2e7d32;

  /* Sidebar */
  --sidebar-w:     268px;

  /* Radius */
  --radius:        8px;

  /* Fonts */
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-heading: 'Crimson Pro', Georgia, serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-dark); }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--topbar-bg);
  margin-top: 0;
}
p { margin-top: 0; }
ul, ol { padding-left: 1.4rem; }
img { max-width: 100%; }

/* ==========================================================
   TOP BAR
   ========================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  height: 60px;
  padding: 0 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--topbar-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
}
.menu-toggle:hover { background: rgba(255,255,255,0.12); }

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--topbar-text);
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; color: var(--accent-light); }

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}
.logo-sub {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.75;
  display: block;
  letter-spacing: 0.03em;
}

.topbar-tagline {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1rem;
  opacity: 0.75;
  margin-left: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================
   OVERALL LAYOUT  (sidebar + main side-by-side)
   ========================================================== */
.layout {
  display: flex;
  min-height: calc(100vh - 60px - 48px); /* viewport minus topbar+footer */
}

/* ==========================================================
   SIDEBAR  (left navigation)
   ========================================================== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 2px solid var(--border);
  position: sticky;
  top: 60px;               /* stick below topbar */
  height: calc(100vh - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--border-light);
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--border-light); }

/* Section header labels */
.nav-section {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 1rem 1rem 0.3rem 1.1rem;
  margin-top: 0.4rem;
}

/* Nav links */
.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  position: relative;
}
.sidebar a::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
}
.sidebar a.sub-link {
  padding-left: 2.2rem;
  font-size: 0.83rem;
}
.sidebar a.sub-link::before { width: 5px; height: 5px; }

.sidebar a:hover {
  background: var(--surface-hover);
  border-left-color: var(--accent-light);
  color: var(--accent-dark);
  text-decoration: none;
}
.sidebar a:hover::before { background: var(--accent-light); }

.sidebar a.active {
  background: var(--active-bg);
  border-left-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}
.sidebar a.active::before { background: var(--accent); }

/* Mobile overlay (hidden on desktop) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

/* ==========================================================
   MAIN CONTENT AREA
   ========================================================== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Page hero banner */
.page-hero {
  background: linear-gradient(135deg, var(--topbar-bg) 0%, #6b2f0a 100%);
  color: var(--topbar-text);
  padding: 2rem 2.5rem 1.8rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,  transparent, transparent 29px, rgba(255,255,255,0.04) 30px),
    repeating-linear-gradient(90deg, transparent, transparent 29px, rgba(255,255,255,0.04) 30px);
}
.page-hero-inner { position: relative; z-index: 1; }
.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}
.page-hero p {
  font-style: italic;
  opacity: 0.8;
  margin: 0;
  font-size: 0.95rem;
}

/* Decorative Om drifts */
.hero-deco {
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: 5rem;
  opacity: 0.08;
  color: #fff;
  user-select: none;
  z-index: 0;
}

/* Content wrapper */
.content {
  padding: 2rem 2.5rem;
  max-width: 900px;
}

.content-wide {
  padding: 2rem 2.5rem;
}

/* ==========================================================
   HOME PAGE HERO  (special larger hero)
   ========================================================== */
.home-hero {
  background: linear-gradient(135deg, var(--topbar-bg) 0%, #6b2f0a 60%, #d16d2a 100%);
  color: var(--topbar-text);
  padding: 3.5rem 2.5rem 3rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,  transparent, transparent 29px, rgba(255,255,255,0.04) 30px),
    repeating-linear-gradient(90deg, transparent, transparent 29px, rgba(255,255,255,0.04) 30px);
}
.home-hero-inner { position: relative; z-index: 1; }
.home-om {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.home-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}
.home-hero .tagline {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.15rem;
  opacity: 0.85;
  margin-bottom: 2rem;
}

/* ==========================================================
   CARDS / FEATURE GRID
   ========================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  padding: 2rem 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(61,26,3,0.12);
}
.card-icon { font-size: 2rem; margin-bottom: 0.6rem; }
.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--accent-dark);
}
.card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* ==========================================================
   SHLOKA / QUOTE BLOCK
   ========================================================== */
.shloka {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.shloka p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--green);
  line-height: 1.8;
  margin: 0 0 0.4rem 0;
}
.shloka cite {
  font-size: 0.82rem;
  color: var(--text-light);
  display: block;
  text-align: right;
}

/* ==========================================================
   SIDEBAR EVENT / NOTICE BOX (right column on home)
   ========================================================== */
.notice-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}
.notice-box h3 {
  font-size: 0.95rem;
  color: var(--accent-dark);
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}
.notice-box ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.87rem;
  color: var(--text-muted);
}
.notice-box ul li { margin-bottom: 0.5rem; }
.notice-box p { font-size: 0.87rem; color: var(--text-muted); margin: 0; }

/* ==========================================================
   TWO-COLUMN layout within content (main + aside)
   ========================================================== */
.cols {
  display: flex;
  gap: 2rem;
  padding: 2rem 2.5rem;
  align-items: flex-start;
}
.col-main { flex: 1; min-width: 0; }
.col-aside { width: 240px; flex-shrink: 0; }

/* ==========================================================
   SECTION DIVIDER
   ========================================================== */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--topbar-bg);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.2rem;
}

/* ==========================================================
   INFO TABLE  (used on various pages)
   ========================================================== */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.info-table th, .info-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
.info-table th {
  background: var(--topbar-bg);
  color: #fff;
  font-weight: 600;
  text-align: left;
}
.info-table tr:nth-child(even) { background: var(--surface); }

/* ==========================================================
   CHART / HOROSCOPE STYLES  (chart.html)
   ========================================================== */
.chart-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
}
.chart-form-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.chart-form-card input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  font-size: 0.93rem;
  margin-bottom: 1rem;
}
.chart-form-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(209,109,42,0.15);
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* Chart grid */
.house table, .navamsa table, .bhava table {
  float: left;
  border: 2px solid var(--accent-dark);
  border-collapse: collapse;
  margin: 10px;
}
.house td, .navamsa td, .bhava td {
  border: 1px solid var(--border);
  height: 90px;
  width: 90px;
  text-align: center;
  vertical-align: middle;
  font-size: 0.78rem;
  background: var(--surface);
}
.house td.center-label, .navamsa td.center-label, .bhava td.center-label {
  background: rgba(209,109,42,0.15);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-dark);
}

.tooltip-planet {
  padding: 2px 4px;
  margin: 2px;
  position: relative;
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: default;
  font-size: 0.78rem;
}
.tooltip-planet .tip-text {
  visibility: hidden;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--topbar-bg);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
}
.tooltip-planet:hover .tip-text { visibility: visible; }
.tooltip-planet:hover { background: var(--accent); color: #fff; }

/* Planet data table */
#planets {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.83rem;
}
#planets th {
  background: var(--topbar-bg);
  color: #fff;
  padding: 7px 10px;
  text-align: left;
}
#planets td { border: 1px solid var(--border); padding: 5px 8px; }
#planets tr:nth-child(even) { background: var(--surface); }

/* Dasa table */
#dtabfull { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
#dtabfull td, #dtabfull th {
  border: 1px solid var(--border);
  padding: 3px 5px;
}
#dtabfull th { background: var(--surface); font-size: 0.75rem; }
.dasa-current { background: #b3d9ff !important; }

.CellWithComment { position: relative; }
.CellComment {
  display: none;
  position: absolute;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 5px 8px;
  width: 200px;
  font-size: 0.8rem;
  bottom: 1.5rem;
  left: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.CellWithComment:hover .CellComment { display: block; }

/* User data summary */
#UserData { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
#UserData td { border: 1px solid var(--border); padding: 4px 8px; }
#UserData .cuh { background: var(--active-bg); font-weight: 600; color: var(--text-muted); }

/* jQuery UI tab & accordion overrides */
.ui-tabs { background: transparent; border: none; }
.ui-tabs .ui-tabs-nav { background: var(--surface); border-color: var(--border); }
.ui-tabs .ui-tabs-nav li.ui-state-active a { color: var(--accent-dark); font-weight: 600; }
.ui-accordion .ui-accordion-content { padding: 4px 8px; background: var(--bg); }
.ui-accordion .ui-accordion-header { background: var(--surface); border-color: var(--border); }

/* ==========================================================
   STATUS / LOADING MESSAGES
   ========================================================== */
.status-msg {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.87rem;
  font-weight: 500;
}
.status-msg.loading { background: #fff3cd; color: #856404; }
.status-msg.success { background: #d1e7dd; color: #0f5132; }
.status-msg.error   { background: #f8d7da; color: #842029; }

/* ==========================================================
   COMING SOON PLACEHOLDER
   ========================================================== */
.coming-soon {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-light);
}
.coming-soon .cs-icon { font-size: 3rem; margin-bottom: 1rem; }
.coming-soon h2 { font-size: 1.5rem; color: var(--text-muted); }
.coming-soon p  { max-width: 450px; margin: 0 auto; font-size: 0.92rem; }

/* ==========================================================
   FOOTER
   ========================================================== */
footer {
  background: var(--topbar-bg);
  color: rgba(252,252,230,0.55);
  text-align: center;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
footer a { color: rgba(252,252,230,0.7); }
footer a:hover { color: var(--accent-light); text-decoration: underline; }

/* ==========================================================
   PROCESS STEPS  (used on econsult / pconsult)
   ========================================================== */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.4rem;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.steps li > div { flex: 1; }
.steps li > div strong { display: block; margin-bottom: 0.2rem; }

/* ==========================================================
   RESPONSIVE  —  ≤ 768px: collapse sidebar to hamburger
   ========================================================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding-top: 60px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .topbar-tagline { display: none; }
  .content, .content-wide { padding: 1.2rem 1rem; }
  .cols { flex-direction: column; padding: 1.2rem 1rem; }
  .col-aside { width: 100%; }
  .card-grid { padding: 1.2rem 1rem; }
  .page-hero { padding: 1.5rem 1.2rem; }
  .home-hero { padding: 2rem 1.2rem 2rem; }
  .hero-deco { display: none; }
}

@media (min-width: 769px) {
  .menu-toggle { display: none; }
}
