/* ============================================
   Tibetan Astrology - Design System
   Soft, minimal, Tibetan-inspired
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  /* Colors */
  --primary: #8B1D1D;
  --accent: #D4AF37;
  --text-dark: #261F1A;
  --text-light: #7A7A7A;
  --white: #FFFFFF;
  --overlay: rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #1A1A1A;

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

  /* Typography */
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', -apple-system, sans-serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  background-color: #2C1810;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: fixed center/cover no-repeat 
    url('../assets/images/background.jpg');
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
  pointer-events: none;
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-dark);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--primary);
  opacity: 0.9;
}

/* ========== Navbar ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: rgba(139, 29, 29, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--accent);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
}

.navbar__logo img {
  height: 40px;
  width: auto;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.navbar__links a {
  color: var(--white);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.navbar__links a:hover,
.navbar__links a.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.navbar__dropdown {
  position: relative;
}

.navbar__dropdown-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar__dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin-top: var(--space-xs);
  padding: var(--space-sm);
  background: rgba(26, 26, 26, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
  list-style: none;
}

.navbar__dropdown:hover .navbar__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.navbar__dropdown-menu a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--white);
  border-radius: var(--radius-sm);
}

.navbar__dropdown-menu a:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent);
}

.btn-login {
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-login:hover {
  background: var(--accent);
  color: var(--primary);
}

/* ========== Buttons ========== */
.btn-primary {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-normal), color var(--transition-normal), transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  background: var(--white);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-normal), color var(--transition-normal);
}

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

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

/* ========== Cards ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-normal);
}

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

/* ========== Forms ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--text-dark);
}

.form-group {
  margin-bottom: var(--space-md);
}

/* ========== Hero sections ========== */
.hero {
  background-color: #000;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  will-change: background-position;
  transition: background-position 0.05s linear;
  box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.5);
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  max-width: 1190px;
  margin: var(--space-xl) auto;
  border-radius: var(--radius-md);
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero--parallax {
  background-attachment: scroll;
  background-position: center 30%;
}

.hero__title {
  color: var(--white);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

/* ========== Section ========== */
.section {
  padding: var(--space-2xl) var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.section__title {
  text-align: center;
  margin-bottom: var(--space-xl);
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ========== Footer ========== */
.footer {
  background: #8B1D1D;; /* slightly lighter than pure black */
  color: #d4af37;
  text-align: center;
  padding: var(--space-xl);
  margin-top: auto;
}


.footer a {
  color: #d4af37;
  text-decoration: underline;
}

.footer__mantra {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: var(--space-md) 0;
  letter-spacing: 0.1em;
}

.footer__links {
  margin-top: var(--space-md);
}

.footer__links a {
  color: var(--accent);
  margin: 0 var(--space-sm);
}

.footer__links a:hover {
  text-decoration: underline;
}

/* Admin footer link: hidden for regular visitors, used by site maintainers only */
.footer__admin-link {
  display: none;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--space-xl);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--accent);
  position: relative;
}

.modal__header {
  padding: var(--space-lg);
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.modal__title {
  margin: 0;
  font-size: 1.5rem;
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
  padding: 0;
  line-height: 1;
}

.modal__tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.modal__tab {
  flex: 1;
  padding: var(--space-md);
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  color: var(--text-light);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.modal__tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}

.modal__tab:hover:not(.active) {
  background: rgba(139, 29, 29, 0.05);
}

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

.modal__panel {
  display: none;
}

.modal__panel.active {
  display: block;
}

.modal__message {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

/* ========== Calendar grid ========== */
.calendar {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-sm);
}

.calendar__day-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  padding: var(--space-sm);
  color: var(--text-dark);
}

.calendar__day {
  min-height: 44px;
  padding: var(--space-sm);
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* Calendar energy – soft earthy colors (green / yellow / red). Use high specificity so these always win. */
.calendar .calendar__day.energy-high {
  background: #d4edda !important; /* soft green */
  color: #155724 !important;
}
.calendar .calendar__day.energy-medium {
  background: #fff3cd !important; /* soft yellow */
  color: #856404 !important;
}
.calendar .calendar__day.energy-low {
  background: #f8d7da !important; /* soft red */
  color: #721c24 !important;
}

/* Fallback for calendar days without an energy class (e.g. empty cells) */
.calendar__day:not(.energy-high):not(.energy-medium):not(.energy-low) {
  background: #f5f5f5;
}

.calendar__day .lunar-day { font-weight: 600; }
.calendar__day .element { font-size: 0.75rem; opacity: 0.9; }

/* ========== Report badges ========== */
.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge--excellent { background: #d4edda; color: #155724; }
.badge--good { background: #cce5ff; color: #004085; }
.badge--mixed { background: #fff3cd; color: #856404; }
.badge--challenging { background: #f8d7da; color: #721c24; }
.badge--high { background: #d4edda; color: #155724; }
.badge--medium { background: #fff3cd; color: #856404; }
.badge--low { background: #f8d7da; color: #721c24; }

/* ========== Utility ========== */
.text-center { text-align: center; }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ========== Layout (main content min-height for footer) ========== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* ========== Blog cards ========== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.blog-card {
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-normal);
  color: var(--text-dark);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card h3 {
  color: #8B1D1D !important;
}

.blog-card .date,
.blog-card__date {
  color: #D4AF37 !important;
}

.blog-card p {
  color: #333333 !important;
}

.blog-card__date {
  font-size: 0.85rem;
  margin-bottom: var(--space-xs);
}

.blog-card__title {
  margin-bottom: var(--space-sm);
}

.blog-card__excerpt {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

/* ========== Tool cards (Tools page) ========== */
.tool-card {
  max-width: 860px;
  margin: 0 auto var(--space-2xl);
}

.tool-description {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.tool-readmore {
  margin-top: var(--space-md);
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.tool-readmore:hover {
  text-decoration: underline;
}

.tool-content {
  margin-top: var(--space-md);
}

.hidden {
  display: none !important;
}

/* ========== Product grid (store) ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-normal);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f0f0f0;
}

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

.product-card__title {
  margin-bottom: var(--space-sm);
}

.product-card__price {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

/* ========== Ritual cards ========== */
.ritual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.ritual-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-normal);
}

.ritual-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ritual-card__price {
  color: var(--accent);
  font-weight: 600;
  margin: var(--space-sm) 0;
}

/* ========== Collapsible content ========== */
.collapsible__trigger {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  margin-top: var(--space-sm);
}

.collapsible__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.collapsible__content.expanded {
  max-height: 2000px;
}

/* ========== Name cards (baby names) ========== */
.name-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.name-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.name-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.name-card__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.name-card__meta {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.pagination button {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--primary);
  background: var(--white);
  color: var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--primary);
  color: var(--white);
}

/* ========== Filter bar (store) ========== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  justify-content: center;
}

.filter-bar button {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.filter-bar button:hover,
.filter-bar button.active,
.filter-bar__btn.active {
  background: var(--accent);
  color: var(--primary);
}

/* ========== Report page ========== */
.cosmic-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.zodiac-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin-bottom: var(--space-md);
}

.report-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.report-section h2 {
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.energy-badge {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border-radius: 50px;
  font-weight: bold;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--primary);
  margin-left: var(--space-sm);
}

.report-section h3 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid #eee;
}

/* ========== Dashboard ========== */
.report-list {
  list-style: none;
}

.report-list__item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
}

/* ========== Admin table ========== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.admin-table th,
.admin-table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid #eee;
}

.admin-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.admin-table tr:hover td {
  background: rgba(139, 29, 29, 0.05);
}

/* ========== 404 page ========== */
.error-page {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
}

.error-page h1 {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.error-page p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xl);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    padding: var(--space-md);
  }

  .navbar__links {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .navbar__dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    display: none;
    margin-top: 0;
    margin-left: var(--space-md);
  }

  .navbar__dropdown.open .navbar__dropdown-menu {
    display: block;
  }

  .calendar__day {
    min-height: 44px;
    font-size: 0.8rem;
  }

  .hero {
    padding: var(--space-2xl) var(--space-md);
  }
}

/* Cart modal */
#cart-items {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: var(--space-md);
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid #eee;
}
.cart-item:last-child {
  border-bottom: none;
}
.btn-remove {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  cursor: pointer;
}
.btn-remove:hover {
  background: var(--primary);
  color: white;
}

.section p {
  color: rgba(255, 255, 255, 0.95); /* light text on dark background */
  font-weight: 400;
}
.card p {
  color: var(--text-dark); /* dark text on light card background */
}