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

:root {
  --ag-black: #0f172a;
  --ag-black2: #f8fafc;
  --ag-panel: rgba(255,255,255,.85);
  --ag-panel2: rgba(248,250,252,.90);
  --ag-border: rgba(15,23,42,.12);
  --ag-text: #0f172a;
  --ag-muted: #475569;
  --primary: #7041ff;
  --primary-hover: #592be0;
  --bg-dark: #ede9fe;
  --bg-card: rgba(255,255,255,.90);
  --radius: 14px;
  --transition: all 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(-45deg, #e0f2fe, #fbcfe8, #ede9fe, #ccfbf1) !important;
  background-size: 400% 400% !important;
  animation: lightGradientBG 15s ease infinite;
  color: var(--ag-text) !important;
  line-height: 1.6;
  overflow-x: hidden;
}
@keyframes lightGradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

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

h1, h2, h3, h4, h5, h6, strong, b, label {
  color: #fff !important;
}

p, .subtext, .business-description, .business-meta, .pagehero p {
  color: var(--ag-muted) !important;
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
header {
  height: 78px;
  padding: 10px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--ag-border);
}

.logo img {
  width: 200px;
  max-height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(139, 92, 255, 0.25));
}

.menu-toggle {
  display: none;
  border: 0;
  background: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

nav {
  display: flex;
  gap: 18px;
  align-items: center;
  position: relative;
  z-index: 1001;
}

nav > a, nav .dropbtn {
  color: var(--ag-text);
  font-weight: 700;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  position: relative;
  transition: color 0.25s ease, transform 0.25s ease;
}

nav > a:hover, nav .dropbtn:hover {
  color: #7c3aed !important;
  transform: translateY(-2px);
}

nav .dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 8px;
  margin-top: 6px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--ag-border);
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(15,23,42,.15);
  z-index: 9999;
}

nav .dropdown.open .dropdown-menu {
  display: block;
}

nav .dropdown-menu a {
  display: block;
  width: 100%;
  padding: 10px 14px;
  color: var(--ag-text) !important;
  border-radius: 8px;
  white-space: nowrap;
  font-weight: 600;
}

nav .dropdown-menu a:hover {
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  color: #fff !important;
  transform: translateX(4px);
}

/* ==========================================================================
   3. HERO, HEADINGS & FILTERS
   ========================================================================== */
.pagehero {
  text-align: center;
  padding: 60px 5%;
  background: linear-gradient(145deg, #090a18, #0b1225, #140b1d) !important;
  border-bottom: 1px solid var(--ag-border);
}

.premium-heading {
  text-align: center !important;
  margin-bottom: 2rem;
}

.pill {
  display: inline-block;
  color: #fff !important;
  background: linear-gradient(90deg, rgba(139, 92, 255, 0.25), rgba(0, 217, 255, 0.16), rgba(255, 62, 165, 0.18)) !important;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 1rem;
}

.pagehero h1, .premium-heading h1, .premium-heading h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 0.75rem;
}

.student-banner {
  max-width: 800px;
  margin: 1.5rem auto 0;
  padding: 12px 18px;
  border: 1px solid rgba(0, 217, 255, 0.25);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(112, 65, 255, 0.12), rgba(0, 217, 255, 0.10), rgba(255, 61, 154, 0.08));
  color: #cbd3ee;
}

.filters, .directory-filter {
  max-width: 900px;
  margin: 2rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #101326 !important;
  border: 1px solid var(--ag-border) !important;
}

.filters input, .filters select, .directory-filter input, .directory-filter select {
  flex: 1 1 180px;
  background: #080b18 !important;
  color: #fff !important;
  border: 1px solid #2b3150 !important;
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
  font: inherit;
  font-size: 0.95rem;
}

/* ==========================================================================
   4. CARDS GRID & PREMIUM SECTION (4 TOOLS PER ROW)
   ========================================================================== */
main.section, .ai-directory-premium, .reference-tools {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.cards, .premium-grid, .reference-scroll {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.card, .premium-card, .reference-card {
  background: linear-gradient(145deg, #0a0a0b, #111113) !important;
  border: 1px solid var(--ag-border) !important;
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover, .premium-card:hover, .reference-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 58, 237, 0.45) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 25px rgba(124, 58, 237, 0.15) !important;
}

.premium-logo { font-size: 2.5rem; margin-bottom: 0.5rem; }
.premium-label { position: absolute; top: 1.25rem; right: 1.25rem; font-size: 0.75rem; background: rgba(255, 255, 255, 0.05); padding: 0.25rem 0.6rem; border-radius: 6px; color: var(--ag-muted); }
.rating-row { color: #ffb703; font-size: 0.9rem; margin-bottom: 0.25rem; }
.rating-count { color: var(--ag-muted); font-size: 0.8rem; margin-left: 4px; }
.price-row { font-size: 0.85rem; color: #54f0a7; margin-bottom: 1rem; font-weight: 700; }

.btn.primary {
  display: inline-block;
  text-align: center;
  background: linear-gradient(90deg, #7545ff, #00cfff, #ff3ea5) !important;
  color: #fff !important;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  font-weight: 700;
  border: 0;
  box-shadow: 0 0 20px rgba(139, 92, 255, 0.25);
  margin-top: auto;
}

.reference-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.reference-tag { font-size: 0.7rem; color: #8257ff; font-weight: 800; letter-spacing: 1px; }
.reference-rating { font-size: 0.85rem; color: #ffb703; margin-top: 0.5rem; }

/* ==========================================================================
   5. FOOTER & LOGO RESIZING
   ========================================================================== */
.ag-footer, footer {
  background: #05060e !important;
  border-top: 1px solid var(--ag-border);
  padding: 4rem 5% 2rem;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.ag-footer img, footer img, .ag-footer-brand img, .footer-logo {
  max-width: 130px !important;
  max-height: 38px !important;
  object-fit: contain;
  margin-bottom: 0.8rem;
}

.ag-footer-brand h3 { margin: 0.5rem 0 0.5rem; font-size: 1.1rem; }
.ag-footer-brand p, footer p, footer a { color: #858da8 !important; }

.ag-footer div b, footer b {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #fff !important;
}

.ag-footer div a, footer a {
  display: block;
  color: #858da8 !important;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.ag-footer-bottom, .copy {
  grid-column: 1 / -1;
  border-top: 1px solid var(--ag-border);
  padding-top: 1.5rem;
  text-align: center;
  color: #70778f !important;
  font-size: 0.85rem;
  background: transparent !important;
}

/* ==========================================================================
   6. RESPONSIVE MOBILE & HORIZONTAL SCROLLING STYLES
   ========================================================================== */
@media (max-width: 1100px) {
  .cards, .premium-grid, .reference-scroll {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  nav {
    display: none;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,.96);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--ag-border);
    gap: 0.75rem;
  }
  nav.open { display: flex; }
  nav .dropdown { width: 100%; display: flex; flex-direction: column; align-items: flex-start; }
  nav .dropdown .dropbtn { width: 100%; justify-content: space-between; }
  nav .dropdown-menu { position: static; width: 100%; box-shadow: none; background: #101326; }
  .ag-footer, footer { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 600px) {
  .cards, .premium-grid, .reference-scroll { grid-template-columns: 1fr; }
  .ag-footer, footer { grid-template-columns: 1fr; }
  
  /* Force horizontal scroll containers to show roughly one card per view on mobile */
  .ai-tool-card-scroll,
  .medium-featured-card,
  .business-card-medium { 
    min-width: 85vw; 
    max-width: 85vw; 
    min-height: auto; 
  }
}

/* ==========================================================================
   7. REVEAL & ANIMATION CSS (FIXES BLANK PAGE / INVISIBILITY ISSUE)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}/* AIGlobalTool Business Directory App */
.biz-app{max-width:1200px;margin:0 auto;padding:32px 20px}.biz-hero{padding:48px 20px;text-align:center;background:linear-gradient(135deg,#0b1225,#17112a);border-bottom:1px solid var(--ag-border)}.biz-search{display:grid;grid-template-columns:1fr 1.8fr auto;gap:10px;max-width:900px;margin:24px auto}.biz-search input,.biz-search select,.form-grid input,.form-grid textarea,.form-grid select{width:100%;padding:13px 14px;border:1px solid #343b5a;border-radius:10px;background:#0b0e1d;color:#fff}.btn{display:inline-flex;align-items:center;justify-content:center;padding:12px 18px;border:0;border-radius:10px;background:linear-gradient(90deg,#7041ff,#ec4899);color:#fff;font-weight:700;cursor:pointer}.btn.secondary{background:#1a2038}.btn.danger{background:#b91c1c}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.card{background:#0d0f1d;border:1px solid #272d46;border-radius:16px;padding:18px}.biz-card{display:flex;flex-direction:column;gap:10px}.biz-card img{width:100%;height:150px;object-fit:cover;border-radius:12px}.biz-meta{display:flex;gap:8px;flex-wrap:wrap;font-size:13px;color:#b5b5b5}.badge{display:inline-block;padding:4px 9px;border-radius:999px;background:#222946;color:#ddd;font-size:12px}.badge.green{background:#123c2b;color:#7ff0b8}.badge.gold{background:#44340d;color:#ffd76a}.form-card{max-width:850px;margin:30px auto}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.form-grid .full{grid-column:1/-1}.form-grid textarea{min-height:130px;resize:vertical}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse}.data-table th,.data-table td{padding:12px;border-bottom:1px solid #282d42;text-align:left;vertical-align:top}.data-table th{color:#fff}.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:15px}.stat{padding:20px;border-radius:14px;background:#0d0f1d;border:1px solid #272d46}.stat strong{display:block;font-size:28px}.alert{padding:12px 15px;border-radius:10px;margin-bottom:18px;background:#19223c;border:1px solid #33446e}.alert.success{background:#0f2d22;border-color:#1e6a4b}.alert.error{background:#3a1519;border-color:#7c2d32}.profile{max-width:850px;margin:30px auto}.profile-head{display:flex;gap:20px;align-items:center}.profile-logo{width:110px;height:110px;border-radius:16px;object-fit:cover;background:#161a2c}.empty{text-align:center;padding:50px;color:#aaa}.top-actions{display:flex;gap:10px;justify-content:space-between;align-items:center;margin-bottom:20px;flex-wrap:wrap}.admin-nav{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}.small{font-size:13px;color:#aaa}.price{font-size:25px;font-weight:800}.package-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.package-card{border:1px solid #303750;border-radius:16px;padding:22px;background:#0d0f1d}.package-card ul{padding-left:20px;color:#b5b5b5;min-height:100px}.notice{font-size:13px;color:#aaa;margin-top:10px}@media(max-width:800px){.grid,.package-grid,.stat-grid{grid-template-columns:1fr 1fr}.biz-search,.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}}@media(max-width:520px){.grid,.package-grid,.stat-grid{grid-template-columns:1fr}.profile-head{align-items:flex-start;flex-direction:column}}

/* AIGlobalTool GLOBAL LIGHT GRADIENT THEME */
body{background:linear-gradient(-45deg,#e0f2fe,#fbcfe8,#ede9fe,#ccfbf1)!important;background-size:400% 400%!important;animation:agGlobalLightGradient 15s ease infinite!important;color:#0f172a}
@keyframes agGlobalLightGradient{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}

.ag-register-highlight,.form-card{position:relative;overflow:hidden;border-radius:24px!important;background:rgba(255,255,255,.82)!important;box-shadow:0 20px 60px rgba(15,23,42,.13)!important}.ag-register-highlight:before,.form-card:before{content:"";position:absolute;inset:-2px;border-radius:26px;padding:2px;background:conic-gradient(#7041ff,#22d3ee,#db2777,#f59e0b,#7041ff);animation:agRegRotate 5s linear infinite;z-index:0;opacity:.55}.ag-register-highlight>*,.form-card>*{position:relative;z-index:1}@keyframes agRegRotate{to{transform:rotate(360deg)}}.form-card .btn,.ag-register-highlight .btn{background:linear-gradient(90deg,#7041ff,#0284c7,#db2777)!important;color:#fff!important}.form-card input,.form-card select,.form-card textarea{background:rgba(255,255,255,.94)!important;color:#0f172a!important;border:1px solid rgba(15,23,42,.13)!important}.form-card input:focus,.form-card select:focus,.form-card textarea:focus{border-color:#7041ff!important;box-shadow:0 0 0 4px rgba(112,65,255,.11)!important}

/* Footer section headings — strong coloured blocks */
.ag-footer-col > div > b{display:block!important;width:fit-content;min-width:150px;padding:9px 16px!important;margin:0 0 14px!important;border-radius:8px;background:linear-gradient(90deg,#7041ff,#0284c7,#db2777)!important;color:#fff!important;font-weight:800!important;letter-spacing:.2px;box-shadow:0 6px 16px rgba(15,23,42,.16)}

/* Global responsive image safety: no image may overflow its desktop/mobile container. */
img{max-width:100%;height:auto}
img[width],img[height]{max-width:100%;box-sizing:border-box}
@media(max-width:700px){img{max-width:100%;height:auto}}
