/* ============================================================
   NAKUL PATHOLOGY LAB — components.css
   Reusable UI: buttons, cards, badges, forms, alerts,
   loaders, modals, toasts, search/filter bars.
   ============================================================ */

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.4rem;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .1s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 1.05em; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: var(--shadow); }

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-dark); color: #fff; box-shadow: var(--shadow); }

.btn-outline { background: #fff; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-ghost { background: transparent; color: var(--heading); }
.btn-ghost:hover { background: var(--surface); }

.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: var(--surface); color: var(--primary-dark); }

.btn-white-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-white-outline:hover { background: #fff; color: var(--primary); }

.btn-sm { padding: .5rem 1rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: .9rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* -------------------- Badges & chips -------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 100px;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-teal { background: #E4F6F4; color: var(--secondary-dark); }
.badge-off { background: var(--success-light); color: var(--success); }

.chip {
  display: inline-flex; align-items: center;
  padding: .45rem .95rem; border-radius: 100px;
  background: #fff; border: 1px solid var(--border);
  color: var(--text); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: all .18s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* -------------------- Generic card -------------------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #D5E2F0; }

/* Icon feature card */
.icard { text-align: left; }
.icard .icard-ico {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--primary-light); color: var(--primary);
  font-size: 1.5rem; margin-bottom: 1rem;
}
.icard h5 { margin-bottom: .4rem; font-size: 1.05rem; }
.icard p { color: var(--text-light); font-size: .92rem; margin: 0; }

/* -------------------- Test card -------------------- */
.test-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  height: 100%;
}
.test-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #D5E2F0; }
.test-card-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem .75rem;
}
.test-card-ico {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--primary-light); color: var(--primary); font-size: 1.35rem;
}
.test-card-body { padding: 0 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.test-card-body h5 { font-size: 1.02rem; margin-bottom: .4rem; }
.test-card .meta { font-size: .82rem; color: var(--text-light); display: flex; align-items: center; gap: .35rem; margin-bottom: .5rem; }
.test-card .desc { font-size: .88rem; color: var(--text-light); margin-bottom: .9rem; }
.test-card .prep {
  font-size: .8rem; color: var(--secondary-dark);
  background: #E4F6F4; border-radius: 8px; padding: .35rem .6rem;
  margin-bottom: .9rem; display: inline-flex; gap: .35rem; align-items: center;
  align-self: flex-start;
}
.test-card .price-row { display: flex; align-items: baseline; gap: .5rem; margin-bottom: 1rem; margin-top: auto; }
.test-card .price { font-size: 1.35rem; font-weight: 800; color: var(--heading); }
.test-card .strike { text-decoration: line-through; color: var(--text-light); font-size: .9rem; }

/* -------------------- Package card -------------------- */
.pkg-card {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm); height: 100%;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pkg-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pkg-card.featured { border-color: var(--primary); box-shadow: 0 12px 30px rgba(11,107,203,.14); }
.pkg-card .pkg-flag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 4px 14px; border-radius: 100px; letter-spacing: .04em;
}
.pkg-card .pkg-ico {
  display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--primary-light); color: var(--primary); font-size: 1.6rem; margin-bottom: 1rem;
}
.pkg-card h4 { font-size: 1.2rem; margin-bottom: .3rem; }
.pkg-card .pkg-count { font-size: .85rem; color: var(--secondary-dark); font-weight: 600; margin-bottom: 1rem; }
.pkg-card .pkg-price { display: flex; align-items: baseline; gap: .5rem; margin-bottom: 1.25rem; }
.pkg-card .pkg-price .now { font-size: 1.75rem; font-weight: 800; color: var(--heading); }
.pkg-card .pkg-price .old { text-decoration: line-through; color: var(--text-light); }
.pkg-card ul { margin-bottom: 1.5rem; flex: 1; }
.pkg-card ul li { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; margin-bottom: .55rem; color: var(--text); }
.pkg-card ul li i { color: var(--success); margin-top: .18rem; flex-shrink: 0; }

/* -------------------- Forms -------------------- */
.form-group { margin-bottom: 1.15rem; }
.form-label {
  display: block; font-weight: 600; font-size: .88rem;
  color: var(--heading); margin-bottom: .4rem;
}
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%;
  padding: .72rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.form-control::placeholder { color: #9AA7B8; }
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,107,203,.14);
}
textarea.form-control { resize: vertical; min-height: 96px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235B6B82' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.2rem; }
.form-control.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .8rem; margin-top: .3rem; display: none; }
.form-control.invalid ~ .field-error { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.15rem; }

/* File upload */
.upload-box {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem 1.5rem; text-align: center; cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  background: var(--surface);
}
.upload-box:hover, .upload-box.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-box .upload-ico { font-size: 2.4rem; color: var(--primary); margin-bottom: .5rem; }
.upload-list { margin-top: .9rem; }
.upload-item {
  display: flex; align-items: center; gap: .6rem;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: .55rem .75rem; margin-bottom: .5rem; font-size: .88rem;
}
.upload-item i.file { color: var(--primary); }
.upload-item .rm { margin-left: auto; border: none; background: none; color: var(--danger); font-size: 1rem; }

/* -------------------- Search & filter bar -------------------- */
.search-bar {
  display: flex; align-items: center; gap: .5rem;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; padding: .35rem .35rem .35rem 1rem;
  box-shadow: var(--shadow-sm); max-width: 620px;
}
.search-bar i { color: var(--text-light); }
.search-bar input { flex: 1; border: none; outline: none; font-size: .98rem; padding: .55rem .4rem; font-family: inherit; }
.filter-row { display: flex; flex-wrap: wrap; gap: .55rem; }

/* -------------------- Alerts -------------------- */
.alert {
  display: flex; align-items: flex-start; gap: .65rem;
  border-radius: 10px; padding: .85rem 1.1rem; font-size: .92rem;
  margin-bottom: 1rem;
}
.alert i { margin-top: .12rem; }
.alert-success { background: var(--success-light); color: #14713a; border: 1px solid #BEE6CB; }
.alert-danger { background: var(--danger-light); color: #a41d1d; border: 1px solid #F4C7C7; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #C9DEF6; }

/* -------------------- State blocks (loading / error / empty) -------------------- */
.state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}
.state i { font-size: 2.4rem; margin-bottom: .75rem; display: block; }
.state.state-error i { color: var(--danger); }
.state.state-empty i { color: var(--text-light); }
.state h5 { color: var(--heading); margin-bottom: .35rem; }
.state p { margin-bottom: 1rem; }

/* Spinner */
.spinner {
  width: 40px; height: 40px; margin: 0 auto 1rem;
  border: 3px solid var(--surface-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; display: inline-block; margin: 0; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #f0f5fb 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* -------------------- Modal -------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 36, 64, .55);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: modalIn .22s ease;
}
.modal-lg { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-header h5 { margin: 0; }
.modal-close { border: none; background: none; font-size: 1.3rem; color: var(--text-light); line-height: 1; }
.modal-close:hover { color: var(--heading); }
.modal-body { padding: 1.5rem; }
.modal-success-ico {
  width: 68px; height: 68px; margin: 0 auto 1rem;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--success-light); color: var(--success); font-size: 2rem;
}

/* -------------------- Toast -------------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #fff; border-left: 4px solid var(--success);
  box-shadow: var(--shadow-md); border-radius: 10px;
  padding: .85rem 1.25rem; display: flex; align-items: center; gap: .6rem;
  font-size: .92rem; font-weight: 500; color: var(--heading);
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 3000;
  max-width: 92vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-left-color: var(--danger); }
.toast i { color: var(--success); font-size: 1.15rem; }
.toast.error i { color: var(--danger); }

/* -------------------- Reviews -------------------- */
.review-card { height: 100%; display: flex; flex-direction: column; }
.review-card .stars { color: #F5A623; margin-bottom: .6rem; }
.review-card .quote { color: var(--text); font-size: .95rem; margin-bottom: 1rem; flex: 1; }
.review-author { display: flex; align-items: center; gap: .7rem; }
.review-author .av {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  background: var(--primary-light); color: var(--primary);
}
.review-author .name { font-weight: 700; color: var(--heading); font-size: .92rem; }
.review-author .loc { font-size: .8rem; color: var(--text-light); }

/* -------------------- Gallery -------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.gallery-item {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .gallery-cap {
  position: absolute; inset: auto 0 0 0;
  padding: 1.4rem .9rem .7rem;
  color: #fff; font-size: .85rem; font-weight: 600;
  background: linear-gradient(180deg, transparent, rgba(15,36,64,.82));
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.gallery-item:hover .gallery-cap,
.gallery-item:focus-visible .gallery-cap { opacity: 1; transform: none; }
.gallery-item .gallery-zoom {
  position: absolute; top: .6rem; right: .6rem;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,.9); color: var(--primary); font-size: 1rem;
  opacity: 0; transition: opacity .25s ease;
}
.gallery-item:hover .gallery-zoom { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(9, 20, 36, .92);
  display: none; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.lightbox.open { display: flex; }
.lightbox-figure { margin: 0; max-width: min(1000px, 96vw); text-align: center; }
.lightbox img {
  max-width: 100%; max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  margin-inline: auto;
}
.lightbox figcaption { color: #fff; margin-top: .9rem; font-size: .95rem; }
.lightbox-btn {
  position: absolute;
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; border: none;
  font-size: 1.5rem; transition: background .2s ease;
}
.lightbox-btn:hover { background: rgba(255,255,255,.28); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: .85rem; }

/* Doctor card */
.doctor-card { text-align: center; }
.doctor-photo {
  width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: var(--primary-light); color: var(--primary); font-size: 2.2rem;
}
.doctor-photo .verified {
  position: absolute; bottom: 2px; right: 2px;
  color: var(--secondary); font-size: 1.1rem; background: #fff; border-radius: 50%;
}
.doctor-card h5 { margin-bottom: .2rem; font-size: 1.02rem; }
.doctor-card .spec { color: var(--primary); font-size: .85rem; font-weight: 600; }
.doctor-card .exp { color: var(--text-light); font-size: .82rem; }
