/* ==========================================================================
   Khan Creative Studio - Public Website - Components
   Buttons, cards, filters, forms, modal, lightbox, toast, FAQ, empty states
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.97rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--white);
  box-shadow: 0 12px 26px rgba(75, 34, 144, 0.28);
}

.btn-primary:hover {
  color: var(--white);
  box-shadow: 0 16px 34px rgba(75, 34, 144, 0.36);
}

.btn-accent {
  background: linear-gradient(135deg, var(--mint-500), var(--mint-600));
  color: var(--purple-950);
  box-shadow: 0 12px 26px rgba(31, 169, 132, 0.25);
}

.btn-accent:hover {
  color: var(--purple-950);
}

.btn-outline {
  background: transparent;
  color: var(--purple-700);
  border-color: var(--purple-200);
}

.btn-outline:hover {
  border-color: var(--purple-700);
  color: var(--purple-900);
  background: var(--purple-50);
}

.btn-ghost {
  background: var(--white);
  color: var(--purple-900);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  color: var(--purple-700);
  border-color: var(--purple-200);
}

.btn-light {
  background: var(--white);
  color: var(--purple-900);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.15);
}

.btn-light:hover {
  color: var(--purple-700);
}

.btn-whatsapp {
  background: #25d366;
  color: var(--white);
  box-shadow: 0 12px 26px rgba(37, 211, 102, 0.28);
}

.btn-whatsapp:hover {
  color: var(--white);
  background: #1ebe5b;
}

.btn-sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.5);
  border-top-color: var(--white);
  animation: spin 0.8s linear infinite;
}

.btn-ghost.is-loading::after,
.btn-outline.is-loading::after {
  border-color: var(--purple-200);
  border-top-color: var(--purple-700);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.card-actions .btn {
  flex: 1 1 auto;
}

/* ---------- Tags / pills ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--mint-100);
  color: var(--mint-700);
}

.tag-purple {
  background: var(--purple-100);
  color: var(--purple-700);
}

/* ---------- Service cards ---------- */
.service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  min-width: 0;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(123, 79, 209, 0.22);
}

.service-visual {
  position: relative;
  height: 170px;
  display: grid;
  place-items: center;
  background: var(--gradient-brand);
  overflow: hidden;
  color: var(--white);
}

.service-visual::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  top: -110px;
  right: -60px;
}

.service-visual::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(111, 220, 183, 0.35);
  bottom: -30px;
  left: 18px;
}

.service-visual.alt {
  background: linear-gradient(135deg, var(--mint-500), var(--mint-700));
  color: var(--purple-950);
}

.service-visual.alt::before {
  border-color: rgba(26, 10, 46, 0.12);
}

.service-visual i {
  font-size: 3.2rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.16));
  transition: transform 0.5s var(--ease);
}

.service-card:hover .service-visual i {
  transform: scale(1.08) rotate(-4deg);
}

.service-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.service-body {
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.service-body h3 {
  font-size: 1.15rem;
  margin: 12px 0 10px;
}

.service-body p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 22px;
}

/* ---------- Filter chips ---------- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-family: var(--font-body);
}

.chip:hover {
  border-color: var(--purple-200);
  color: var(--purple-700);
}

.chip.is-active {
  background: var(--gradient-brand);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 10px 20px rgba(75, 34, 144, 0.22);
}

/* ---------- Portfolio cards ---------- */
.project-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  width: 100%;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.project-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--gradient-brand);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--white);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: transform 0.6s var(--ease);
}

.project-card:hover .project-media img {
  transform: scale(1.06);
}

.project-media i {
  font-size: 2.6rem;
  opacity: 0.9;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(26, 10, 46, 0.85));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  color: var(--white);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay {
  opacity: 1;
}

.project-overlay span {
  font-size: 0.85rem;
  opacity: 0.85;
}

.project-body {
  padding: 20px 22px 22px;
}

.project-body h3 {
  font-size: 1.05rem;
  margin: 8px 0 6px;
}

.project-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- FAQ accordion (native details) ---------- */
.faq-list {
  display: grid;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 24px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary i {
  color: var(--purple-700);
  transition: transform 0.3s var(--ease);
  flex-shrink: 0;
}

.faq-item[open] summary i {
  transform: rotate(180deg);
}

.faq-item .faq-answer {
  padding: 0 24px 22px;
  color: var(--text);
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label,
.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.required::after {
  content: " *";
  color: var(--danger);
}

.form-control {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

textarea.form-control {
  min-height: 130px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--purple-700) 50%),
    linear-gradient(135deg, var(--purple-700) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.form-control:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 4px rgba(123, 79, 209, 0.14);
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(214, 51, 108, 0.1);
}

.field-error {
  color: var(--danger);
  font-size: 0.84rem;
  min-height: 0;
  display: none;
}

.field-error.show {
  display: block;
}

.form-hint {
  font-size: 0.84rem;
  color: var(--muted);
}

.form-alert {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  margin-top: 16px;
}

.form-alert.show {
  display: block;
}

.form-alert.error {
  background: #fff0f4;
  color: #a31d4c;
  border: 1px solid #ffc9d9;
}

.form-alert.success {
  background: var(--mint-100);
  color: #0f6f56;
  border: 1px solid #b8efdc;
}

/* Honeypot: hidden from people, visible to bots that fill every field */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-item {
  position: relative;
}

.checkbox-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  transition: all 0.2s var(--ease);
  min-height: 52px;
}

.checkbox-item label i.check-box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--purple-200);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: transparent;
  font-size: 0.7rem;
}

.checkbox-item input:checked + label {
  border-color: var(--purple-500);
  background: var(--purple-50);
  box-shadow: 0 0 0 3px rgba(123, 79, 209, 0.12);
}

.checkbox-item input:checked + label i.check-box {
  background: var(--purple-700);
  border-color: var(--purple-700);
  color: var(--white);
}

.checkbox-item input:focus-visible + label {
  outline: 3px solid var(--mint-500);
  outline-offset: 2px;
}

/* ---------- Contact cards ---------- */
.contact-info-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.contact-info-card .feature-icon {
  margin: 0;
  width: 50px;
  height: 50px;
  font-size: 1.1rem;
  border-radius: 14px;
}

.contact-info-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.contact-info-card p,
.contact-info-card a {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  word-break: break-word;
}

/* ---------- Modal (quotation request, lightbox) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 10, 46, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.25s var(--ease);
}

.modal-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100svh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.35s var(--ease);
  min-width: 0;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 26px 30px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--purple-50), var(--white));
}

.modal-head h2 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.modal-close {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  color: var(--danger);
  border-color: #ffc9d9;
}

.modal-body {
  padding: 24px 30px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  padding: 18px 30px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--white);
}

.modal-section-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-700);
  margin: 22px 0 14px;
}

.modal-section-title:first-child {
  margin-top: 0;
}

.lightbox-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--purple-950);
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  color: var(--white);
}

.lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
}

.lightbox-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scrollbar-width: thin;
}

.lightbox-thumbs button {
  flex: 0 0 auto;
  width: 84px;
  height: 60px;
  border-radius: 12px;
  border: 2px solid transparent;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--purple-100);
}

.lightbox-thumbs button.is-active {
  border-color: var(--mint-500);
}

.lightbox-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Toast notifications ---------- */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  font-size: 0.93rem;
  color: var(--ink);
  animation: toastIn 0.35s var(--ease);
}

.toast i {
  font-size: 1.1rem;
  margin-top: 2px;
}

.toast.success i {
  color: var(--success);
}

.toast.error i {
  color: var(--danger);
}

.toast.info i {
  color: var(--purple-700);
}

/* ---------- Loading, skeleton, empty ---------- */
.loader {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--purple-100);
  border-top-color: var(--purple-700);
  animation: spin 0.8s linear infinite;
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #f1edf9 25%, #faf8ff 50%, #f1edf9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 320px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  border: 1.5px dashed var(--purple-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--muted);
}

.empty-state i {
  font-size: 2.4rem;
  color: var(--purple-200);
  margin-bottom: 14px;
}

.empty-state h3 {
  color: var(--ink);
  font-size: 1.1rem;
}

.empty-state p {
  margin: 0 auto;
  max-width: 460px;
}

/* ---------- Related portfolio mini cards ---------- */
.mini-project {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  min-width: 0;
}

.mini-project:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.mini-project .thumb {
  width: 84px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
  color: var(--white);
}

.mini-project .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-project strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
}

.mini-project span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Service detail layout ---------- */
.detail-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.detail-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--line);
}

.detail-list i {
  color: var(--mint-700);
  margin-top: 5px;
  flex-shrink: 0;
}

.sticky-card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 30px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
}

.sticky-card h3 {
  color: var(--white);
  font-size: 1.35rem;
}

.sticky-card p {
  color: rgba(255, 255, 255, 0.85);
}

.sticky-card .btn {
  width: 100%;
}

.sticky-card .btn + .btn {
  margin-top: 12px;
}

.not-found-card {
  text-align: center;
  padding: 80px 24px;
}

/* Social icons on light backgrounds (contact page) */
.socials.on-light a {
  background: var(--purple-50);
  border-color: var(--line);
  color: var(--purple-700);
}

.socials.on-light a:hover {
  background: var(--purple-700);
  color: var(--white);
}

/* Contact page info cards that are links */
a.contact-info-card {
  color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

a.contact-info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}

a.contact-info-card h3 {
  color: var(--ink);
}

.contact-info-card .feature-icon {
  color: var(--white);
}

.contact-info-card .feature-icon.mint {
  background: linear-gradient(135deg, var(--mint-500), var(--mint-700));
  color: var(--purple-950);
}
