/* ===================================================
   CALENDARIUM SOLARIS — Stylesheet v3
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

/* ── RESET & CSS VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sun-gold:    #F2A900;
  --sun-deep:    #D47C0F;
  --sun-light:   #FFF3D6;
  --dawn-orange: #E8622A;
  --sky-warm:    #FDF6E3;
  --text-dark:   #2C1A0E;
  --text-mid:    #5C3D1E;
  --text-light:  #9C7040;
  --white:       #FFFFFF;
  --shadow:      rgba(44,26,14,0.15);
  --shadow-lg:   rgba(44,26,14,0.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--sky-warm);
  color: var(--text-dark);
  line-height: 1.7;
}

/* ── HEADER ── */
header {
  background: linear-gradient(135deg, #1a0a00 0%, #3d1f00 40%, #7a3d00 70%, #D47C0F 100%);
  color: var(--white);
  text-align: center;
  padding: 1.4rem 1rem 1.8rem;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute; top: -50%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(242,169,0,0.3) 0%, transparent 70%);
  pointer-events: none;
}
.sun-emblem {
  font-size: 1.8rem; margin-bottom: 0.2rem; display: block;
  animation: pulse-sun 4s ease-in-out infinite;
}
@keyframes pulse-sun {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.08); opacity: 0.85; }
}
header h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700; letter-spacing: 0.05em;
  color: var(--sun-gold);
  text-shadow: 0 0 30px rgba(242,169,0,0.5);
}
header p.tagline {
  font-size: 0.85rem; color: rgba(255,255,255,0.7);
  margin-top: 0.2rem; font-weight: 300; letter-spacing: 0.08em;
}

/* ── NAV ── */
nav {
  background: var(--text-dark);
  display: flex; justify-content: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px var(--shadow);
  padding: 0 1rem;
}
nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 1rem 1.8rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem; letter-spacing: 0.08em;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
nav a:hover, nav a.active {
  color: var(--sun-gold);
  border-bottom-color: var(--sun-gold);
  background: rgba(242,169,0,0.08);
}

/* ── MAIN LAYOUT ── */
main { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }

/* ── SECTIONS ── */
section { margin-bottom: 5rem; }
section h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--sun-deep); margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--sun-gold);
  display: inline-block;
}
section p {
  font-size: 1.05rem; color: var(--text-mid);
  max-width: 800px; margin-bottom: 1.2rem;
}

/* ── HERO INTRO ── */
.hero-intro {
  background: linear-gradient(135deg, #fff8e7, #ffefc0);
  border-left: 5px solid var(--sun-gold);
  border-radius: 0 12px 12px 0;
  padding: 2rem 2.5rem; margin-bottom: 3rem;
  box-shadow: 0 4px 20px var(--shadow);
}
.hero-intro p { font-size: 1.15rem; color: var(--text-dark); font-style: italic; }

/* ── FEATURE CARDS ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.card {
  background: var(--white); border-radius: 12px;
  padding: 1.8rem; box-shadow: 0 4px 15px var(--shadow);
  border-top: 4px solid var(--sun-gold);
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px var(--shadow); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h3 { font-family: 'Cinzel', serif; color: var(--sun-deep); font-size: 1rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; color: var(--text-mid); margin: 0; }

/* ── TABLES ── */
.month-table, .compare-table {
  width: 100%; border-collapse: collapse; margin-top: 1.5rem;
  background: var(--white); border-radius: 12px;
  overflow: hidden; box-shadow: 0 4px 15px var(--shadow);
}
.month-table th, .compare-table th {
  background: var(--text-dark); color: var(--sun-gold);
  font-family: 'Cinzel', serif; font-size: 0.8rem;
  letter-spacing: 0.1em; padding: 0.85rem 1rem; text-align: left;
}
.month-table td, .compare-table td {
  padding: 0.7rem 1rem; border-bottom: 1px solid #f0e0c0;
  font-size: 0.95rem; color: var(--text-mid);
}
.month-table tr:last-child td, .compare-table tr:last-child td { border-bottom: none; }
.month-table tr:hover td, .compare-table tr:hover td { background: var(--sun-light); }
.month-table td.nr { color: var(--text-light); font-weight: 700; width: 40px; }
.month-table td.special { color: var(--dawn-orange); font-style: italic; }
.compare-table td.highlight { color: var(--sun-deep); font-weight: 700; }
.compare-table tr.highlight-row td { background: var(--sun-light); }

/* ── CTA BUTTON ── */
.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, var(--sun-gold), var(--dawn-orange));
  color: var(--white); padding: 1rem 2.5rem; border-radius: 50px;
  text-decoration: none; font-family: 'Cinzel', serif;
  font-size: 1rem; letter-spacing: 0.08em;
  box-shadow: 0 4px 15px rgba(242,169,0,0.4);
  transition: all 0.3s; margin-top: 1.5rem;
}
.cta-button:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(242,169,0,0.5); }

/* ── FOOTER ── */
footer {
  background: var(--text-dark); color: rgba(255,255,255,0.6);
  text-align: center; padding: 2rem 1rem; font-size: 0.85rem;
}
footer a { color: var(--sun-gold); text-decoration: none; }

/* ================================================
   CALENDAR PAGE — unified calendar styles
   ================================================ */

/* Today Banner */
.today-banner-wrap {
  background: linear-gradient(135deg, #1a0a00, #3d1f00);
  border-radius: 16px; padding: 2rem 2.5rem;
  text-align: center; margin-bottom: 2.5rem;
  box-shadow: 0 6px 25px rgba(44,26,14,0.3);
}
.today-label {
  font-family: 'Cinzel', serif; font-size: 0.8rem;
  letter-spacing: 0.15em; color: var(--sun-gold);
  text-transform: uppercase; margin-bottom: 0.5rem;
}
.today-solaris {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  color: var(--sun-gold); font-weight: 700;
  text-shadow: 0 0 20px rgba(242,169,0,0.4);
}
.today-gregorian {
  font-size: 0.95rem; color: rgba(255,255,255,0.5);
  margin-top: 0.4rem; font-style: italic;
}

/* Calendar Navigation */
.cal-nav {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
/* Single-row nav (used in calendar page) */
.cal-nav-bar { display:flex; align-items:center; gap:0.6rem; margin-bottom:1.2rem; }
.cal-nav-btn {
  background: var(--text-dark); color: var(--sun-gold);
  border: none; padding: 0.6rem 1.4rem; border-radius: 8px;
  font-family: 'Cinzel', serif; font-size: 0.9rem;
  cursor: pointer; transition: background 0.2s;
}
.cal-nav-btn:hover { background: var(--sun-deep); color: white; }
.cal-nav-btn.today-btn {
  background: linear-gradient(135deg, var(--sun-gold), var(--dawn-orange));
  color: white; padding: 0.6rem 1.8rem;
}
#calendar-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.95rem, 1.8vw, 1.5rem);
  color: var(--sun-deep); text-align: center; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Calendar Grid — 5 columns */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.cal-header {
  background: var(--text-dark); color: var(--sun-gold);
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  letter-spacing: 0.08em; text-align: center;
  padding: 0.65rem 0.2rem; border-radius: 6px;
}
.cal-day {
  background: var(--white); border-radius: 8px;
  padding: 0.5rem 0.55rem;
  min-height: 110px;
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-start;
  box-shadow: 0 1px 3px var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer; position: relative;
  border: 1px solid rgba(242,169,0,0.12);
  overflow: hidden;
}
.cal-day:hover { box-shadow: 0 2px 10px var(--shadow); border-color: var(--sun-gold); }
.cal-day.today {
  background: linear-gradient(160deg, #fff8e7 0%, #ffeab0 100%);
  border: 2px solid var(--sun-gold);
  box-shadow: 0 3px 12px rgba(242,169,0,0.25);
}
.cal-day.selected {
  background: var(--sun-deep);
  border: 2px solid var(--sun-gold);
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}
.cal-day.selected .cal-day-num,
.cal-day.selected .cal-day-greg,
.cal-day.selected .cal-day-sun { color: white; }

/* Day top row: number + gregorian date */
.cal-day-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}
.cal-day-num {
  font-family: 'Cinzel', serif; font-size: 1.05rem;
  font-weight: 700; color: var(--text-dark); line-height: 1;
}
.cal-day.today .cal-day-num { color: var(--sun-deep); }
.cal-day.selected .cal-day-num { color: white; }
.cal-day-greg {
  font-size: 0.65rem; color: var(--text-light);
}
.cal-day.selected .cal-day-greg { color: rgba(255,255,255,0.75); }
.cal-day.today .cal-day-greg { color: var(--text-mid); }
.cal-day-sun { font-size: 0.78rem; color: var(--sun-gold); }
.cal-day.selected .cal-day-sun { color: white; }

/* Appointment pills */
.cal-appt-pill {
  font-size: 0.68rem;
  border-radius: 3px;
  padding: 1px 5px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  font-weight: 600;
  line-height: 1.5;
}
.cal-appt-more {
  font-size: 0.62rem;
  color: var(--text-light);
  padding-left: 3px;
}
.cal-day.selected .cal-appt-more { color: rgba(255,255,255,0.7); }

/* Grey placeholder cells for split-anchor months */
/* Wide single-day cell spanning all 5 columns (standalone anchor/outside days) */

.cal-day-no-leap {
  background: rgba(200, 50, 50, 0.06);
  border: 1px dashed rgba(200, 50, 50, 0.35);
  cursor: default;
}
.cal-day-no-leap:hover {
  transform: none;
  border-color: rgba(200, 50, 50, 0.35);
}

/* Grey placeholder cells for split-anchor months */
.cal-day-grey {
  background: var(--white);
  border-radius: 8px;
  min-height: 110px;
  cursor: default;
  border: 1px solid rgba(242,169,0,0.2);
  position: relative;
  padding-bottom: 1.5rem;
}
.cal-day-grey::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1.4rem;
  background: rgba(242,169,0,0.05);
  border-top: 1px solid rgba(242,169,0,0.2);
  border-radius: 0 0 7px 7px;
}

/* Last grey cell in the post-anchor row — shows the anchor name */
.cal-day-anchor-cell {
  align-items: stretch;
  justify-content: flex-start;
  cursor: pointer;
}
/* Anchor cell — spans multiple columns, with outside-day label */
.cal-day-anchor-cell {
  border: 1px solid rgba(242,169,0,0.45);
  position: relative;
  padding-bottom: 1.5rem !important;
  cursor: pointer;
  align-items: stretch;
}
.cal-day-anchor-cell::after {
  content: 'outside day';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  font-size: 0.55rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sun-gold);
  background: rgba(242,169,0,0.07);
  border-top: 1px solid rgba(242,169,0,0.25);
  text-align: center;
  padding: 2px 0;
  border-radius: 0 0 7px 7px;
}
.cal-day-anchor-cell.today {
  border-color: var(--dawn-orange);
}
.cal-day-anchor-cell.today::after {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.25);
}
.cal-day-anchor-cell.selected {
  background: var(--sun-deep) !important;
  border-color: var(--sun-gold);
}
.cal-day-anchor-cell.selected::after {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.1);
  border-top-color: rgba(255,255,255,0.2);
}
.cal-day-anchor-cell.selected .cal-day-num,
.cal-day-anchor-cell.selected .cal-day-greg { color: white; }

/* Grey cell selected state */
.cal-day-grey.selected {
  background: var(--sun-deep) !important;
  border: 2px solid var(--sun-gold) !important;
}

.cal-day-num {
  font-family: 'Cinzel', serif; font-size: 1.1rem;
  font-weight: 700; color: var(--text-dark); line-height: 1;
}
.cal-day-greg { font-size: 0.62rem; color: var(--text-light); margin-top: 2px; }
.cal-day-sun  { font-size: 0.85rem; line-height: 1; margin: 1px 0; }


/* ── DATE CONVERTER ── */
.converter-box {
  background: var(--white); border-radius: 12px;
  padding: 1.5rem; margin-top: 3rem; margin-bottom: 2.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid rgba(242,169,0,0.2);
}
.converter-box h3 {
  font-family: 'Cinzel', serif; color: var(--sun-deep);
  text-align: center; margin-top: 0; margin-bottom: 1.5rem; font-size: 1.4rem;
}
.converter-forms {
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center;
}
.form-group {
  flex: 1; min-width: 260px;
  background: rgba(242,169,0,0.05);
  padding: 1.2rem; border-radius: 8px;
  border: 1px solid rgba(242,169,0,0.15);
  display: flex; flex-direction: column; gap: 0.8rem;
}
.form-group label {
  font-family: 'Cinzel', serif; font-weight: 700;
  color: var(--text-dark); font-size: 0.95rem; text-align: center;
}
.form-controls { display: flex; gap: 0.5rem; }
.form-controls input, .form-controls select {
  padding: 0.6rem; border: 1px solid #ccc; border-radius: 6px;
  font-family: inherit; font-size: 0.9rem;
  background: var(--white); color: var(--text-dark);
  min-width: 0;
}
.jump-btn {
  background: var(--text-dark); color: var(--sun-gold);
  border: none; padding: 0.8rem; border-radius: 6px;
  font-family: 'Cinzel', serif; font-weight: bold;
  font-size: 0.9rem; cursor: pointer; transition: all 0.2s; margin-top: 0.5rem;
}
.jump-btn:hover { background: var(--sun-deep); color: white; }
.converter-result {
  text-align: center; font-size: 1.1rem; font-family: 'Cinzel', serif;
  font-weight: bold; color: var(--sun-deep);
  margin-top: 1.5rem; min-height: 1.5rem;
}

/* ── APPOINTMENTS PANEL ── */
.appt-panel {
  background: var(--white); border-radius: 12px;
  padding: 1.5rem; margin-top: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid rgba(242,169,0,0.2);
}
.appt-panel h3 {
  font-family: 'Cinzel', serif; color: var(--sun-deep);
  margin-top: 0; margin-bottom: 1rem; font-size: 1.2rem;
  border-bottom: 1px solid rgba(242,169,0,0.3); padding-bottom: 0.6rem;
}
.appt-form { display: flex; flex-direction: column; gap: 0.7rem; }
.appt-form input, .appt-form textarea {
  padding: 0.65rem 0.8rem; border: 1px solid #ddd; border-radius: 6px;
  font-family: inherit; font-size: 0.9rem;
  color: var(--text-dark); background: var(--sky-warm);
  width: 100%;
}
.appt-form input:focus, .appt-form textarea:focus {
  outline: none; border-color: var(--sun-gold);
  box-shadow: 0 0 0 2px rgba(242,169,0,0.15);
}
.appt-form textarea { resize: vertical; min-height: 60px; }
.appt-add-btn {
  background: linear-gradient(135deg, var(--sun-gold), var(--dawn-orange));
  color: white; border: none; padding: 0.7rem 1.5rem;
  border-radius: 8px; font-family: 'Cinzel', serif;
  font-size: 0.9rem; cursor: pointer; transition: opacity 0.2s;
}
.appt-add-btn:hover { opacity: 0.9; }
.appt-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.appt-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: rgba(242,169,0,0.07); border-radius: 8px;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--sun-gold);
}
.appt-item-text { flex: 1; }
.appt-item-title { font-weight: 700; font-size: 0.9rem; color: var(--text-dark); }
.appt-item-time  { font-size: 0.78rem; color: var(--text-light); }
.appt-item-note  { font-size: 0.82rem; color: var(--text-mid); margin-top: 0.2rem; }
.appt-del-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-light); font-size: 1rem; padding: 0 0.2rem;
  transition: color 0.2s;
}
.appt-del-btn:hover { color: var(--dawn-orange); }
.export-btn {
  background: var(--text-dark); color: var(--sun-gold);
  border: none; padding: 0.6rem 1.4rem; border-radius: 8px;
  font-family: 'Cinzel', serif; font-size: 0.85rem;
  cursor: pointer; transition: background 0.2s; margin-top: 1rem;
}
.export-btn:hover { background: var(--sun-deep); color: white; }
.login-nudge {
  background: linear-gradient(135deg, #fff8e7, #ffefc0);
  border: 1px dashed var(--sun-gold); border-radius: 10px;
  padding: 1.2rem 1.5rem; text-align: center; margin-top: 2rem;
  font-size: 0.95rem; color: var(--text-mid);
}
.login-nudge a { color: var(--sun-deep); font-weight: 700; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  nav a { padding: 0.75rem 0.9rem; font-size: 0.75rem; }
  .hero-intro { padding: 1.5rem; }
  .cal-header { font-size: 0.6rem; padding: 0.4rem 0.1rem; }
  .cal-day { min-height: 50px; padding: 0.4rem 0.1rem; }
  .cal-day-num { font-size: 0.95rem; }
  .form-controls { flex-direction: column; }
  .form-controls input, .form-controls select { width: 100% !important; }
  .month-table th, .month-table td,
  .compare-table th, .compare-table td { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
}
