/* =============================================
   MAIN STYLESHEET
   Imports modular CSS files + base/reset/shared
   ============================================= */

/* --- Module Imports --- */
@import url("navbar.css");
@import url("hero.css");
@import url("cards.css");
@import url("footer.css");

/* ===== CUSTOM PROPERTIES ===== */
:root {
  --pink: #d63384;
  --purple: #6f42c1;
  --deep-plum: #4a0e4e;
  --soft-bg: #fdf6f9;
  --card-bg: #ffffff;
  --text: #3a3a3a;
  --text-muted: #777;
  --gradient: linear-gradient(135deg, var(--pink), var(--purple));
  --gradient-soft: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 50%, #ede7f6 100%);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(214, 51, 132, 0.15);
  --shadow-glow: 0 8px 32px rgba(214, 51, 132, 0.3);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--soft-bg);
  line-height: 1.7;
  overflow-x: hidden;
}

body.smooth-scroll {
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ===== SHARED BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 28px rgba(214, 51, 132, 0.35);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg);
  transition: none;
  z-index: -1;
}

.btn-primary:hover::after {
  animation: btnShine 0.6s ease-out;
}

@keyframes btnShine {
  0%   { left: -75%; }
  100% { left: 125%; }
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 36px rgba(214, 51, 132, 0.45);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.99);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--deep-plum);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
}

.btn-ghost svg {
  transition: transform var(--transition);
}

.btn-ghost:hover svg {
  transform: translate(2px, -2px);
}

/* ===== SHARED ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  opacity: 0;
  animation: cardReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(40px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@keyframes gentleSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== ACCESSIBILITY ===== */
.btn:focus-visible,
.card-apply:focus-visible,
.category-card:focus-visible,
.back-to-top:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(214, 51, 132, 0.15);
}

::selection {
  background: rgba(214, 51, 132, 0.2);
  color: var(--deep-plum);
}

/* ===== RESPONSIVE ===== */
/* ===== RESPONSIVE — TABLET (max-width: 1024px) ===== */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .helpline-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
  }

  .hero-sub {
    max-width: 520px;
  }

  .section-title::after {
    width: 50px;
  }
}

/* ===== RESPONSIVE — MOBILE (max-width: 768px) ===== */
@media (max-width: 768px) {
  /* Navbar mobile drawer */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(280px, 80vw);
    height: 100vh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 5rem 1.5rem 2rem;
    gap: 0.3rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    padding: 0.8rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }

  .nav-links a:not(.nav-cta)::after {
    display: none;
  }

  .nav-cta {
    margin-top: 1rem;
    text-align: center;
    padding: 0.7rem 1.4rem !important;
    justify-content: center;
    display: block;
  }

  /* Hero section */
  .hero {
    min-height: auto;
    padding: 4.5rem 0 2rem;
  }

  .hero-title {
    font-size: clamp(1.5rem, 6.5vw, 2.2rem);
    line-height: 1.25;
    margin-bottom: 0.8rem;
  }

  .hero-sub {
    font-size: 0.85rem;
    max-width: 90%;
    margin: 0 auto 1.5rem;
    padding: 0 0.5rem;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 0.35rem 0.9rem;
    margin-bottom: 1.2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .btn {
    width: 100%;
    max-width: 240px;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    font-size: 0.82rem;
  }

  .hero-stats {
    gap: 1rem;
    margin-top: 1.8rem;
  }

  .stat-number {
    font-size: 1.35rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .stat-divider {
    height: 26px;
  }

  .hero-scroll-indicator {
    display: none;
  }

  /* Hero orbs — smaller on mobile */
  .hero-orb--1 { width: 160px; height: 160px; }
  .hero-orb--2 { width: 130px; height: 130px; }
  .hero-orb--3 { width: 100px; height: 100px; }
  .hero-orb--4 { width: 80px; height: 80px; }

  /* Sections */
  .categories {
    padding: 2.5rem 0;
  }

  .opportunities {
    padding: 2.5rem 0 3rem;
  }

  section.helpline {
    padding: 2.5rem 0;
  }

  .section-label {
    font-size: 0.68rem;
    letter-spacing: 2px;
  }

  .section-title {
    font-size: clamp(1.3rem, 5vw, 1.7rem);
  }

  .section-sub {
    font-size: 0.82rem;
    padding: 0 0.5rem;
    margin-bottom: 2rem;
  }

  .section-title::after {
    width: 36px;
  }

  /* Category grid */
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    padding: 0 0.25rem;
  }

  .category-card {
    padding: 0.8rem 0.6rem;
    border-radius: 14px;
    min-width: 0;
    gap: 0.4rem;
  }

  .cat-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .cat-icon-wrap svg {
    width: 20px;
    height: 20px;
  }

  .cat-label {
    font-size: 0.72rem;
  }

  .cat-count {
    font-size: 0.62rem;
  }

  /* Card grid */
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.2rem;
    border-radius: 14px;
  }

  .card-icon {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin-bottom: 0.8rem;
  }

  .card-icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  .card-badge {
    font-size: 0.62rem;
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.6rem;
  }

  .card h3 {
    font-size: 0.92rem;
    margin-bottom: 0.4rem;
  }

  .card p {
    font-size: 0.8rem;
    line-height: 1.55;
    margin-bottom: 1rem;
  }

  .card-apply {
    padding: 0.5rem 1.1rem;
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  /* Helpline grid */
  .helpline-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .helpline-card {
    padding: 1.4rem 1.2rem;
  }

  .hl-icon-wrap {
    width: 48px;
    height: 48px;
  }

  .hl-number {
    font-size: 1.5rem;
  }

  .hl-tag {
    font-size: 0.6rem;
    padding: 0.18rem 0.5rem;
  }

  .hl-desc {
    font-size: 0.75rem;
  }

  /* Safety banner */
  .safety-banner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    padding: 1rem 1rem;
    font-size: 0.78rem;
    border-radius: 14px;
  }

  .safety-icon {
    width: 38px;
    height: 38px;
  }

  /* Footer */
  .footer {
    padding: 2.5rem 0 1.5rem;
  }

  .footer-logo {
    font-size: 0.95rem;
  }

  .footer-message {
    font-size: 0.88rem;
    padding: 0 0.5rem;
  }

  .footer-desc {
    font-size: 0.78rem;
    padding: 0 0.5rem;
  }

  .footer-links {
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-links a {
    font-size: 0.75rem;
  }

  .footer-bottom p {
    font-size: 0.75rem;
  }

  .footer-tag {
    font-size: 0.65rem;
  }

  /* Back to top — smaller on mobile */
  .back-to-top {
    width: 38px;
    height: 38px;
    bottom: 1rem;
    right: 1rem;
  }

  /* Disable card tilt on touch (handled by JS, but reinforce) */
  .card:hover {
    transform: translateY(-6px);
  }

  /* Disable parallax orbs on mobile (no hover) */
  .hero-orb {
    animation-duration: 12s;
  }
}

/* ===== RESPONSIVE — SMALL PHONES (max-width: 480px) ===== */
@media (max-width: 480px) {
  .container {
    width: 92%;
  }

  .hero {
    padding: 3.8rem 0 1.5rem;
  }

  .hero-title {
    font-size: clamp(1.25rem, 7vw, 1.7rem);
    line-height: 1.2;
    margin-bottom: 0.6rem;
  }

  .hero-sub {
    font-size: 0.78rem;
    max-width: 100%;
    margin-bottom: 1.2rem;
  }

  .hero-badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.7rem;
    margin-bottom: 1rem;
  }

  .btn {
    max-width: 100%;
    font-size: 0.78rem;
    padding: 0.6rem 1.2rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.5rem;
  }

  .stat-divider {
    display: none;
  }

  .hero-stat {
    flex: 1;
    min-width: 70px;
  }

  .stat-number {
    font-size: 1.15rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  /* Sections */
  .categories {
    padding: 2rem 0;
  }

  .opportunities {
    padding: 2rem 0 2.5rem;
  }

  section.helpline {
    padding: 2rem 0;
  }

  .section-label {
    font-size: 0.62rem;
  }

  .section-title {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
  }

  .section-sub {
    font-size: 0.76rem;
    margin-bottom: 1.5rem;
  }

  /* Category grid — compact on small screens */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .category-card {
    padding: 0.7rem 0.5rem;
    font-size: 0.72rem;
    gap: 0.3rem;
    border-radius: 12px;
  }

  .cat-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .cat-icon-wrap svg {
    width: 17px;
    height: 17px;
  }

  .cat-label {
    font-size: 0.68rem;
  }

  .cat-count {
    font-size: 0.58rem;
  }

  /* Cards */
  .card-grid {
    gap: 0.8rem;
  }

  .card {
    padding: 1rem;
    border-radius: 12px;
  }

  .card-icon {
    width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin-bottom: 0.6rem;
  }

  .card-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .card-badge {
    font-size: 0.58rem;
    padding: 0.18rem 0.5rem;
    margin-bottom: 0.5rem;
  }

  .card h3 {
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
  }

  .card p {
    font-size: 0.75rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
  }

  .card-apply {
    padding: 0.45rem 1rem;
    font-size: 0.72rem;
    gap: 0.3rem;
  }

  /* Helpline */
  .helpline-card {
    padding: 1.2rem 1rem;
  }

  .hl-icon-wrap {
    width: 44px;
    height: 44px;
  }

  .hl-number {
    font-size: 1.3rem;
  }

  .hl-tag {
    font-size: 0.56rem;
    padding: 0.15rem 0.45rem;
  }

  .hl-desc {
    font-size: 0.7rem;
  }

  .safety-banner {
    padding: 0.8rem;
    font-size: 0.72rem;
    border-radius: 12px;
  }

  .safety-icon {
    width: 34px;
    height: 34px;
  }

  .safety-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Footer */
  .footer {
    padding: 2rem 0 1.2rem;
  }

  .footer-message {
    font-size: 0.8rem;
  }

  .footer-desc {
    font-size: 0.72rem;
  }

  .footer-links {
    gap: 0.6rem;
  }

  .footer-links a {
    font-size: 0.7rem;
  }

  .footer-bottom p {
    font-size: 0.7rem;
  }

  .footer-tag {
    font-size: 0.6rem;
  }

  /* Navbar on small phones */
  .logo {
    font-size: 0.92rem;
  }

  .logo-icon {
    width: 22px;
    height: 22px;
  }

  .navbar {
    padding: 0.6rem 0;
  }
}

/* ===== RESPONSIVE — EXTRA SMALL (max-width: 360px) ===== */
@media (max-width: 360px) {
  .container {
    width: 94%;
  }

  .hero {
    padding: 3.5rem 0 1.2rem;
  }

  .hero-title {
    font-size: 1.15rem;
  }

  .hero-sub {
    font-size: 0.72rem;
  }

  .hero-badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.6rem;
  }

  .btn {
    font-size: 0.72rem;
    padding: 0.55rem 1rem;
  }

  .hero-stats {
    gap: 0.4rem;
  }

  .hero-stat {
    min-width: 65px;
  }

  .stat-number {
    font-size: 1.05rem;
  }

  .category-card {
    min-width: 0;
    padding: 0.6rem 0.4rem;
  }

  .cat-icon-wrap {
    width: 30px;
    height: 30px;
  }

  .cat-icon-wrap svg {
    width: 15px;
    height: 15px;
  }

  .cat-label {
    font-size: 0.62rem;
  }

  .card {
    padding: 0.9rem;
  }

  .card h3 {
    font-size: 0.82rem;
  }

  .card p {
    font-size: 0.7rem;
  }

  .card-apply {
    padding: 0.4rem 0.8rem;
    font-size: 0.68rem;
  }

  .helpline-card {
    padding: 1rem 0.8rem;
  }

  .hl-number {
    font-size: 1.15rem;
  }

  .footer-message {
    font-size: 0.72rem;
  }

  .nav-links {
    width: 85vw;
  }
}

/* ===== RESPONSIVE — LARGE SCREENS (min-width: 1400px) ===== */
@media (min-width: 1400px) {
  .container {
    max-width: 1300px;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  /* Disable tilt/parallax effects on touch */
  .card:hover {
    transform: translateY(-6px);
  }

  .hero-orb {
    pointer-events: none;
  }

  /* Bigger tap targets */
  .category-card {
    min-height: 44px;
  }

  .btn {
    min-height: 48px;
  }

  .card-apply {
    min-height: 44px;
    padding: 0.7rem 1.4rem;
  }

  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .footer-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .back-to-top {
    min-width: 48px;
    min-height: 48px;
  }

  /* Disable hover glow on cards (touch won't trigger mousemove) */
  .card::after {
    display: none;
  }

  /* Smooth scrolling category bar indicator */
  .category-grid::-webkit-scrollbar {
    height: 3px;
  }

  .category-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
  }

  .category-grid::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 10px;
  }
}

/* ===== LANDSCAPE PHONE ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 5rem 0 2rem;
  }

  .hero-orb {
    display: none;
  }

  .hero-stats {
    margin-top: 1.5rem;
  }
}
