/* ============================================================
   Juliyans Law Firm & Law School — Custom CSS
   Supplements Tailwind CSS CDN
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  --navy:       #1B2A4A;
  --navy-dark:  #0F1D35;
  --navy-light: #243761;
  --gold:       #C9A84C;
  --gold-light: #E8D48B;
  --gold-dark:  #A8882E;
  --cream:      #F8F7F2;
  --dark:       #1A1A2E;
  --gray:       #6B7280;
  --white:      #FFFFFF;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* contain AOS pre-animation offscreen positions */
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background-color: var(--white);
  overflow-x: hidden; /* prevent AOS fade-left/right from widening the page */
  width: 100%;
}

/* ── Typography ── */
.font-serif {
  font-family: 'Playfair Display', serif;
}

.gold-underline {
  position: relative;
  display: inline-block;
}

.gold-underline::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gold);
}

.gold-underline-center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ── Navigation ── */
#navbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#navbar.scrolled {
  background-color: var(--navy) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--gold);
}

.nav-link:hover::after {
  width: 100%;
}

/* ── Buttons ── */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 2px;
  border: 2px solid var(--gold);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-gold:hover {
  background-color: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
}

.btn-outline-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 2px;
  border: 2px solid var(--gold);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-outline-gold:hover {
  background-color: var(--gold);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
}

.btn-outline-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 2px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: var(--white);
  transform: translateY(-1px);
}

/* ── Hero Section ── */
#hero {
  position: relative;
  min-height: 100vh;
  background-image: url('https://images.unsplash.com/photo-1589829545856-d10d557cf95f?w=1920&q=80&fit=crop');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 29, 53, 0.92) 0%,
    rgba(27, 42, 74, 0.85) 50%,
    rgba(15, 29, 53, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
}

/* Typewriter */
.typewriter-text {
  border-right: 2px solid var(--gold);
  animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { border-color: var(--gold); }
  50% { border-color: transparent; }
}

/* ── About Section ── */
#about {
  background-color: var(--white);
}

.about-image-wrapper {
  position: relative;
}

.about-image-wrapper::before {
  content: '';
  position: absolute;
  top: 20px;
  left: -20px;
  right: 20px;
  bottom: -20px;
  border: 3px solid var(--gold);
  z-index: 0;
  border-radius: 2px;
}

.about-image-wrapper img {
  position: relative;
  z-index: 1;
  border-radius: 2px;
}

/* ── Section Labels ── */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

/* ── Service Cards (Law School) ── */
.service-card {
  background: var(--white);
  border: 1px solid #E5E7EB;
  border-top: 3px solid var(--gold);
  border-radius: 4px;
  padding: 28px;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  box-shadow: 0 10px 40px rgba(27, 42, 74, 0.12);
  transform: translateY(-4px);
  border-top-color: var(--navy);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.service-icon i {
  color: var(--gold);
  font-size: 1.375rem;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.service-list li {
  padding: 5px 0;
  font-size: 0.875rem;
  color: var(--gray);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.service-list li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 7px;
  flex-shrink: 0;
}

/* ── Practice Area Cards (Law Firm) ── */
.practice-card {
  background: var(--white);
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: default;
}

.practice-card:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.15);
  transform: translateY(-3px);
}

.practice-card:hover .practice-icon {
  background: var(--gold);
}

.practice-card:hover .practice-icon i {
  color: var(--navy);
}

.practice-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  transition: all 0.3s ease;
}

.practice-icon i {
  color: var(--gold);
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.practice-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

/* ── CTA Section ── */
#consultation {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  position: relative;
  overflow: hidden;
}

#consultation::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.05);
  pointer-events: none;
}

#consultation::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

/* ── Join Us Cards ── */
.join-card {
  background: var(--white);
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.join-card:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 40px rgba(27, 42, 74, 0.1);
  transform: translateY(-4px);
}

.join-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.join-icon i {
  color: var(--gold);
  font-size: 1.5rem;
}

/* ── Contact Section ── */
#contact {
  background-color: var(--cream);
}

.contact-info-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.contact-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-icon i {
  color: var(--gold);
  font-size: 0.875rem;
}

/* ── Form Styles ── */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.form-input::placeholder {
  color: #9CA3AF;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* ── Footer ── */
footer {
  background: var(--navy-dark);
}

.footer-link {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
  transition: color 0.2s ease;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--gold);
}

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.2s ease;
  text-decoration: none;
}

.social-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 29, 53, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Safe padding that never causes overflow */
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.modal-box {
  background: var(--white);
  border-radius: 6px;
  width: 100%;
  max-width: min(480px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  contain: layout;
  /* Hide scrollbar track (no white line) while keeping scroll ability */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
}
.modal-box::-webkit-scrollbar {
  display: none;                /* Chrome/Safari/Opera */
}

.modal-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-radius: 6px 6px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-sizing: border-box;
  width: 100%;
}

/* Modal form body */
.modal-form-body {
  padding: 16px 20px 20px;
  box-sizing: border-box;
  width: 100%;
}

/* Row = 2-col grid on desktop, stacks on mobile */
.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-field {
  margin-bottom: 10px;
}

.modal-field:last-of-type {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .modal-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  /* Remove double margin when rows collapse */
  .modal-row .modal-field {
    margin-bottom: 10px;
  }
}

/* All inputs inside modal: never overflow */
.modal-form-body .form-input {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
}

/* ── Modal mobile overrides ── */
@media (max-width: 767px) {
  .modal-overlay {
    align-items: flex-start;
    padding: 0;
    padding-top: 80px;   /* clear the fixed navbar */
  }

  .modal-box {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    border-radius: 0;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }

  .modal-header {
    padding: 12px 14px;
    border-radius: 12px 12px 0 0;
  }

  /* Compact phone badges row — stay on one line on mobile */
  .modal-header .flex.flex-wrap {
    gap: 6px;
    margin-top: 6px;
  }

  .modal-header .flex.flex-wrap a {
    font-size: 0.65rem;
    padding: 3px 8px;
    white-space: nowrap;
  }

  .modal-form-body {
    padding: 12px 14px 16px;
  }

  .modal-field {
    margin-bottom: 8px;
  }
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

/* ── WhatsApp Floating Button ── */
#whatsapp-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
  text-decoration: none;
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  animation: whatsapp-pulse 3s infinite;
}

#whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.7);
  animation: none;
}

@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.8), 0 0 0 8px rgba(37, 211, 102, 0.1); }
}

/* ── Toast Notification ── */
#toast {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9999;
  min-width: 260px;
  padding: 14px 20px;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

#toast.success {
  background: #D1FAE5;
  color: #065F46;
  border-left: 4px solid #10B981;
}

#toast.error {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid #EF4444;
}

/* ── Gold Divider ── */
.gold-divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 16px 0 24px;
}

.gold-divider-center {
  margin-left: auto;
  margin-right: auto;
}

/* ── Section Padding ── */
.section-py {
  padding-top: 80px;
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  .section-py {
    padding-top: 100px;
    padding-bottom: 100px;
  }
}

/* ── Scroll to top button ── */
#scroll-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#scroll-top:hover {
  background: var(--gold);
  color: var(--navy);
  transform: translateY(-2px);
}

/* ── Animated entrance (AOS supplement) ── */
[data-aos] {
  transition-duration: 700ms !important;
}

/* ── Mobile menu drawer ── */
#mobile-menu {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Background patterns ── */
.pattern-dots {
  background-image: radial-gradient(rgba(201, 168, 76, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ── Responsive fixes ── */
@media (max-width: 767px) {
  /* No top utility bar on mobile — snap nav to very top */
  #navbar {
    top: 0 !important;
  }

  #hero {
    background-attachment: scroll;
  }

  /* Hide decorative gold frame on mobile to avoid overflow clipping */
  .about-image-wrapper::before {
    display: none;
  }
}

/* ── About section badge z-index fix ── */
.about-image-wrapper {
  position: relative;
}

/* Ensure badge always shows on top of the gold frame border */
.about-image-wrapper > div[class*="absolute"] {
  z-index: 20;
}

/* Practice card click hint on hover */
.practice-card.cursor-pointer::after {
  content: 'Click to inquire';
  display: block;
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.practice-card.cursor-pointer:hover::after {
  opacity: 1;
}

/* ── Logo on dark backgrounds ──
   Converts black logo to white so it shows cleanly on navy navbar/footer.
   The logo (Lady Justice, black on white) is inverted to pure white.
   mix-blend-mode: multiply removes the white background on supported browsers. */
.logo-on-dark {
  filter: brightness(0) invert(1);
  /* Fallback: mix-blend-mode ensures white bg disappears on dark surfaces */
  mix-blend-mode: screen;
}

/* ── Horizontal rule gold ── */
.hr-gold {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0;
}
