/* ============================================================
   frontend/assets/css/style.css — Health Agency Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:       #1a7f5e;
  --primary-dark:  #145f47;
  --primary-light: #e8f5f0;
  --accent:        #f4a24a;
  --accent-dark:   #d4861e;
  --dark:          #0f1c17;
  --text:          #2d3b35;
  --muted:         #6b7f78;
  --border:        #d9e8e2;
  --bg:            #f8fdfb;
  --white:         #ffffff;
  --danger:        #dc3545;
  --success:       #198754;

  --font-head: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;

  --radius:   12px;
  --radius-sm: 6px;
  --shadow:   0 4px 24px rgba(26,127,94,.10);
  --shadow-lg:0 8px 40px rgba(26,127,94,.16);
  --transition: .25s ease;

  --navbar-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); line-height: 1.25; color: var(--dark); }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ---- Navbar ---- */
.ha-navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-h);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(26,127,94,.06);
}

.ha-navbar .navbar-brand {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--primary) !important;
  font-weight: 700;
}

.ha-navbar .nav-link {
  color: var(--text) !important;
  font-weight: 500;
  padding: .5rem .9rem !important;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.ha-navbar .nav-link:hover,
.ha-navbar .nav-link.active {
  background: var(--primary-light);
  color: var(--primary) !important;
}

/* Cart badge */
.cart-wrapper { position: relative; display: inline-block; }
#cart-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--accent);
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ---- Hero ---- */
.ha-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 60%, var(--primary) 100%);
  color: var(--white);
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.ha-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.ha-hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.1; color: var(--white); }
.ha-hero p  { font-size: 1.15rem; color: rgba(255,255,255,.8); max-width: 520px; }

.ha-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--white);
  padding: .35rem 1rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.ha-hero-img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/5;
  object-fit: cover;
}

/* ---- Buttons ---- */
.btn-ha-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: .75rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.btn-ha-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,127,94,.35);
}

.btn-ha-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: .7rem 1.7rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  transition: all var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

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

.btn-ha-accent {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: .75rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  transition: all var(--transition);
  cursor: pointer;
}

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

/* ---- Section headers ---- */
.section-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .3rem .9rem;
  border-radius: 50px;
  margin-bottom: .8rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  color: var(--dark);
  margin-bottom: .6rem;
}

.section-sub {
  color: var(--muted);
  font-size: 1rem;
  max-width: 520px;
}

/* ---- Cards ---- */
.ha-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.ha-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--primary-light);
}

.ha-card-body { padding: 1.4rem; }

.ha-badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ha-badge--green  { background: var(--primary-light); color: var(--primary); }
.ha-badge--amber  { background: #fff5e6; color: var(--accent-dark); }
.ha-badge--red    { background: #fdecea; color: var(--danger); }
.ha-badge--gray   { background: #f0f0f0; color: #555; }

/* ---- Price tag ---- */
.ha-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-head);
}

.ha-price-old {
  font-size: .9rem;
  color: var(--muted);
  text-decoration: line-through;
}

/* ---- Forms ---- */
.ha-form .form-control,
.ha-form .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.ha-form .form-control:focus,
.ha-form .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,127,94,.12);
  outline: none;
}

.ha-form label { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; color: var(--text); }

/* ---- Page hero (inner pages) ---- */
.page-hero {
  background: linear-gradient(135deg, var(--dark), var(--primary-dark));
  color: var(--white);
  padding: 5rem 0 4rem;
  text-align: center;
}

.page-hero h1 { color: var(--white); font-size: clamp(2rem, 4vw, 3.2rem); }
.page-hero p  { color: rgba(255,255,255,.75); font-size: 1.05rem; max-width: 580px; margin: .8rem auto 0; }

/* ---- Values grid ---- */
.value-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition);
}

.value-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.value-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
}

/* ---- Event card ---- */
.event-card {
  display: flex;
  gap: 1.2rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: all var(--transition);
}

.event-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }

.event-date-box {
  min-width: 60px;
  text-align: center;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  padding: .6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.event-date-box .day  { font-size: 1.6rem; font-weight: 700; font-family: var(--font-head); line-height: 1; }
.event-date-box .mon  { font-size: .72rem; text-transform: uppercase; font-weight: 600; opacity: .85; }
.event-date-box .year { font-size: .65rem; opacity: .7; }

/* ---- Cart ---- */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-img {
  width: 72px; height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--primary-light);
  flex-shrink: 0;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: .2rem .4rem;
}

.qty-control button {
  width: 28px; height: 28px;
  border: none;
  background: var(--white);
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.qty-control button:hover { background: var(--primary-light); }
.qty-control span { min-width: 28px; text-align: center; font-weight: 600; }

/* ---- Dashboard ---- */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Admin sidebar ---- */
.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-h));
}

.admin-sidebar {
  width: 240px;
  background: var(--dark);
  padding: 1.5rem 0;
  flex-shrink: 0;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.65);
  padding: .75rem 1.5rem;
  font-weight: 500;
  font-size: .9rem;
  transition: all var(--transition);
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  color: var(--white);
  background: rgba(255,255,255,.08);
  border-left: 3px solid var(--primary);
  padding-left: calc(1.5rem - 3px);
}

.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-x: auto;
}

/* ---- Table ---- */
.ha-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.ha-table th {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .85rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.ha-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ha-table tr:last-child td { border-bottom: none; }
.ha-table tr:hover td { background: var(--primary-light); }

/* ---- Modal form ---- */
.modal-content { border: none; border-radius: var(--radius); }
.modal-header  { border-bottom: 1px solid var(--border); padding: 1.2rem 1.5rem; }
.modal-footer  { border-top:    1px solid var(--border); padding: 1rem 1.5rem; }

/* ---- Toast ---- */
.ha-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--dark);
  color: var(--white);
  padding: .85rem 1.4rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition);
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
}

.ha-toast--error   { border-left-color: var(--danger); }
.ha-toast--warning { border-left-color: var(--accent); }
.ha-toast.show     { opacity: 1; transform: translateY(0); }

/* ---- Loading skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, #e8f0ed 25%, #d6e9e1 50%, #e8f0ed 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- Footer ---- */
.ha-footer {
  background: var(--dark);
  color: rgba(255,255,255,.7);
  padding: 4rem 0 2rem;
}

.ha-footer h5 { color: var(--white); font-family: var(--font-body); font-weight: 700; margin-bottom: 1rem; }
.ha-footer a  { color: rgba(255,255,255,.65); font-size: .9rem; display: block; margin-bottom: .4rem; }
.ha-footer a:hover { color: var(--primary); }

.ha-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 3rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: .82rem;
}

/* ---- Utility ---- */
.text-primary-ha { color: var(--primary) !important; }
.bg-primary-ha   { background: var(--primary) !important; }
.section-pad     { padding: 5rem 0; }
.section-pad-sm  { padding: 3rem 0; }
.gap-card        { gap: 1.5rem; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.empty-state i { font-size: 3rem; color: var(--border); margin-bottom: 1rem; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .ha-hero { min-height: 60vh; }
  .admin-sidebar { display: none; }
  .admin-content { padding: 1rem; }
  .event-card { flex-direction: column; }
  .ha-table { font-size: .78rem; }
  .ha-table th, .ha-table td { padding: .6rem .5rem; }
}
