/* ===============================
   Main CSS Import
================================ */
@import url("variables.css");
@import url("base.css");
@import url("layout.css");
@import url("components.css");
@import url("animations.css");

/* =========================================================
   GLOBAL SAFETY + MOBILE OVERFLOW FIXES
========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body{
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img, video, canvas, svg{
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent long strings from pushing layout */
p, h1, h2, h3, h4, a, li, small, strong, span{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Better container behavior across devices */
.container{
  width: min(1180px, 100% - 32px);
  margin-inline: auto;
}
@media (max-width: 520px){
  .container{ width: calc(100% - 24px); }
}

/* Make the top areas immune to horizontal scroll */
.navbar,
.welcome-strip,
.hero,
section,
header,
footer{
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Fallback for browsers that don't support overflow-x: clip well */
@supports not (overflow: clip){
  .navbar,
  .welcome-strip,
  .hero,
  section,
  header,
  footer{
    overflow-x: hidden;
  }
}

/* =========================================================
   WELCOME STRIP
========================================================= */
.welcome-strip{
  background: linear-gradient(90deg, #0e1b14, #13261d);
  color: #e6f5ee;
  font-size: 0.95rem;
  padding: 10px 0;
  text-align: center;
  letter-spacing: 0.3px;
}
.welcome-strip strong{ color: #4fd18b; }

/* =========================================================
   NAVBAR FIXES (ADDED)
========================================================= */
.navbar{
  position: sticky;
  top: 0;
  z-index: 9990;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Ensure the nav row doesn't push width */
.nav-content{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.logo{
  display: flex;
  align-items: center;
  min-width: 0;
}

/* Force logo to show + scale correctly */
.navbar .logo img{
  display: block !important;
  max-width: 240px;
  width: auto;
  height: auto;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Keep desktop links from forcing overflow */
.nav-links{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

/* Mobile: hide desktop links, use hamburger menu */
@media (max-width: 900px){
  .nav-links{ display: none !important; }
  .hamburger{ display: flex !important; }
}

/* Mobile menu always full width */
.mobile-menu{
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.mobile-menu a{
  display: block;
  padding: 14px 16px;
}

/* Logo scaling breakpoints */
@media (max-width: 768px){
  .navbar .logo img{ max-width: 190px; }
}
@media (max-width: 420px){
  .navbar .logo img{ max-width: 160px; }
}

/* =========================================================
   HERO LAYERS (prevent overlay collisions)
========================================================= */
.hero{
  position: relative;
  overflow: hidden;
}

/* Optional background layer */
.hero-secretary{
  position: absolute;
  inset: 0;
  background-image: url("assets/images/hero/secretary.jpg");
  background-size: cover;
  background-position: right center;
  opacity: 0.18;
  filter: grayscale(20%) contrast(105%);
  z-index: 0;
}

.hero-overlay{ z-index: 1; }

.hero-content{
  position: relative;
  z-index: 2;
}

/* Buttons row wraps on mobile */
.hero .hero-actions{
  display: flex;     /* ADDED: in case base/components doesn't set it */
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   KPI ROW (RESPONSIVE, NO OVERFLOW)
========================================================= */
.kpi-row{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.kpi{
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
}
.kpi b{
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}
.kpi small{
  opacity: .82;
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 1000px){
  .kpi-row{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .kpi-row{ grid-template-columns: 1fr; }
}

/* =========================================================
   SECTION HEAD + CHIP
========================================================= */
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2{ margin: 0; }
.section-head .lead{
  opacity: .85;
  max-width: 720px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  opacity: .92;
}

/* =========================================================
   PILLS
========================================================= */
.pill-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 12px;
}
.pill{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  font-size: 13px;
  cursor:pointer;
  user-select:none;
  transition: transform .15s ease, background .15s ease;
}
.pill:hover{ transform: translateY(-1px); }
.pill.active{
  background: rgba(108,184,255,0.18);
  border-color: rgba(108,184,255,0.28);
}

/* =========================================================
   TABS
========================================================= */
.tabs{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  border-radius: 18px;
  overflow:hidden;
}

.tab-bar{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.tab-btn{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color:#fff;
  cursor:pointer;
}

.tab-btn.active{
  background: rgba(34,197,94,0.16);
  border-color: rgba(34,197,94,0.28);
}

.tab-panels{ padding: 14px; }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

/* =========================================================
   ACCORDION
========================================================= */
.accordion{
  display:grid;
  gap: 12px;
  margin-top: 14px;
}
.acc-item{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  overflow:hidden;
}
.acc-head{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 14px;
  padding: 14px 14px;
  background: transparent;
  color:#fff;
  border:0;
  cursor:pointer;
  text-align:left;
}
.acc-head span{ font-weight: 600; }
.acc-body{
  max-height: 0;
  overflow:hidden;
  transition: max-height .22s ease;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.acc-body > div{
  padding: 14px;
  opacity:.9;
  line-height: 1.6;
}
.acc-item.open .acc-body{ max-height: 260px; }

/* =========================================================
   TESTIMONIALS (CLEAN SINGLE VERSION)
========================================================= */
.testimonials{
  padding: 90px 0;
  background: #0b0f14;
  text-align: center;
}

.testimonial-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.testimonial-card{
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  padding: 35px 25px;
  text-align: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
}

.testimonial-card:hover{
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

.testimonial-card img{
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #00ffd5;
  margin: 0 auto 15px;
}

.testimonial-card h4{
  margin: 10px 0 4px;
  color: #fff;
}

.testimonial-card span{
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  display: block;
}

.testimonial-card p{
  margin-top: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
}

.stars{
  margin-top: 12px;
  color: gold;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

/* =========================================================
   LIVE GEM PRICES
========================================================= */
.live-gems{
  padding: 90px 0;
  background: radial-gradient(circle at top, #111827, #020617);
}

.gems-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.gem-card{
  background: rgba(255,255,255,0.04);
  border-radius: 18px;
  padding: 25px;
  text-align: center;
  transition: transform 0.4s ease;
  border: 1px solid rgba(255,255,255,0.08);
}

.gem-card:hover{
  transform: translateY(-8px) scale(1.03);
}

.gem-card img{
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 15px;
}

.gem-card h4{
  color: #fff;
  margin-bottom: 10px;
}

.gem-card .price{
  font-size: 1.2rem;
  font-weight: bold;
  color: #00ffd5;
}

/* =========================================================
   (OPTIONAL) LIVE MINERALS SECTION (if you still use it)
========================================================= */
.minerals-live{
  padding: 100px 0;
  background: #070a0f;
}
.minerals-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  margin-top: 50px;
}
.mineral-card{
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.mineral-card img{
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.mineral-card:hover img{
  transform: scale(1.15) rotate(2deg);
}

/* =========================================================
   WORLD MAP (LEAFLET)
========================================================= */
#worldMap{
  width: 100%;
  height: min(520px, 60vh);
  margin-top: 40px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
@media (max-width: 520px){
  #worldMap{ height: 52vh; border-radius: 18px; }
}
.leaflet-container{
  background: #000;
  max-width: 100%;
}

/* =========================================================
   ABOUT / OPERATIONS / MINERALS HELPERS (from your paste)
========================================================= */
.about-hero,
.operations-hero{
  min-height: 60vh;
}

.about-grid{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.about-image img{
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.leadership-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
}
.leader-card{
  background: rgba(255,255,255,0.03);
  padding: 22px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.leader-card img{
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 12px;
}

.timeline-track{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.timeline-item{
  background: rgba(255,255,255,0.03);
  padding: 20px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.timeline-item span{
  display: block;
  font-weight: bold;
  color: #4fd18b;
  margin-bottom: 6px;
}

.flow-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}
.flow-step{
  background: rgba(255,255,255,0.03);
  padding: 20px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.flow-step span{
  display: inline-block;
  font-weight: bold;
  color: #4fd18b;
  margin-bottom: 6px;
}

.safety-grid{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.safety-image img{
  width: 100%;
  border-radius: 16px;
}
.safety-list{
  margin-top: 16px;
  list-style: none;
  padding: 0;
}
.safety-list li{ margin-bottom: 8px; }

.stats-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}
.stats-grid .stat h3{ color: #4fd18b; }

.two-col{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
}
.stat-boxes{
  display: grid;
  gap: 18px;
}
.stat{
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.stat span{
  display: block;
  font-size: 1.6rem;
  font-weight: bold;
  color: #f5c77a;
}
.stat small{
  color: rgba(255,255,255,0.65);
  font-size: 0.8rem;
}

/* Minerals page hero image */
.minerals-hero{
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.9)),
    url("../images/hero/mining-hero.jpg") center/cover no-repeat;
}

.section-soft{ background: rgba(255,255,255,0.02); }
.section-dark{ background: #070a0e; }

@media (max-width: 900px){
  .about-grid,
  .safety-grid,
  .two-col{
    grid-template-columns: 1fr;
  }
}

/* Gallery */
.gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.gallery img{
  width: 100%;
  height: clamp(110px, 18vw, 160px);
  object-fit: cover;
  border-radius: 14px;
  background: #0b0f14;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.gallery img:hover{
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
}

/* =========================================================
   AI ASSISTANT (RESPONSIVE + CLEAN)
========================================================= */
.ai-assistant{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  font-family: inherit;
}

.ai-avatar{
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  user-select:none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
  font-size: 26px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ai-avatar:hover{
  transform: translateY(-2px);
  box-shadow: 0 22px 70px rgba(0,0,0,0.45);
}

.ai-panel{
  position:absolute;
  right: 0;
  bottom: 78px;
  width: 360px;
  max-width: calc(100vw - 44px);
  height: 460px;
  max-height: calc(100vh - 140px);
  border-radius: 18px;
  overflow:hidden;

  opacity: 0;
  pointer-events:none;
  transform: translateY(10px) scale(0.98);
  transition: all .18s ease;

  background: rgba(10,14,20,0.78);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}

.ai-panel.open{
  opacity: 1;
  pointer-events:auto;
  transform: translateY(0) scale(1);
}

.ai-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  color: #fff;
}
.ai-header span{ font-weight: 600; letter-spacing: .2px; }

.ai-header button{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor:pointer;
}

.ai-body{
  padding: 14px;
  height: calc(100% - 112px);
  overflow:auto;
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.ai-message{
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.35;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  max-width: 86%;
}
.ai-message.bot{
  background: rgba(255,255,255,0.06);
  color: #e6f5ee;
  align-self: flex-start;
}
.ai-message.user{
  background: rgba(79,209,139,0.20);
  border-color: rgba(79,209,139,0.30);
  color: #e6f5ee;
  align-self: flex-end;
}

.ai-footer{
  display:flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.ai-footer input{
  flex:1;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color:#fff;
  outline:none;
}
.ai-footer button{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(79,209,139,0.22);
  color:#fff;
  cursor:pointer;
}

/* AI on mobile */
@media (max-width: 520px){
  .ai-assistant{ right: 14px; bottom: 14px; }
  .ai-panel{
    width: calc(100vw - 28px);
    height: 70vh;
    max-height: 70vh;
    bottom: 78px;
  }
}

/* =========================================================
   FULL MESSAGING OVERLAY
========================================================= */
.msg-overlay{
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  display:none;
  padding: 18px;
}
.msg-overlay.open{ display:flex; }

.msg-shell{
  width: 920px;
  max-width: 100%;
  height: 86vh;
  margin: auto;
  border-radius: 20px;
  overflow:hidden;
  background: rgba(12,16,24,0.88);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
  display:flex;
  flex-direction: column;
}

.msg-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.msg-title{
  display:flex;
  align-items:center;
  gap: 10px;
}
.msg-title .dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34,197,94,0.12);
}
.msg-title small{ display:block; opacity: .8; margin-top: 2px; }

.msg-actions{ display:flex; gap: 8px; }
.msg-btn{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color:#fff;
  cursor:pointer;
}
.msg-btn.ghost{ background: transparent; }

.msg-body{
  flex:1;
  padding: 16px;
  overflow:auto;
}

.msg-bubble{
  max-width: 78%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
  line-height: 1.35;
  font-size: 14px;
}
.msg-bubble.bot{ background: rgba(255,255,255,0.06); }
.msg-bubble.user{
  margin-left:auto;
  background: rgba(108,184,255,0.16);
  border-color: rgba(108,184,255,0.28);
}

.msg-bottom{
  display:flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.msg-bottom input{
  flex:1;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color:#fff;
  outline:none;
}
.msg-send{
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(34,197,94,0.18);
  color:#fff;
  cursor:pointer;
}

@media (max-width: 640px){
  .msg-overlay{ padding: 0; }
  .msg-shell{ height: 100vh; border-radius: 0; }
}

/* =========================================================
   MODAL
========================================================= */
.modal{
  position: fixed;
  inset: 0;
  z-index: 12000;
  display:none;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(10px);
  padding: 18px;
}
.modal.open{ display:flex; }

.modal-card{
  width: 880px;
  max-width: 100%;
  margin:auto;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(12,16,24,0.90);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
  overflow:hidden;
}
.modal-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.modal-top button{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color:#fff;
  cursor:pointer;
}
.modal-body{
  padding: 14px;
  display:grid;
  gap: 12px;
}
.modal-body p{ opacity:.92; line-height: 1.7; }

/* =========================================================
   FORMS
========================================================= */
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px){
  .form-grid{ grid-template-columns: 1fr; }
}
.field{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.field label{ font-size: 13px; opacity:.9; }
.field input, .field select, .field textarea{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color:#fff;
  outline:none;
  width: 100%;
  max-width: 100%;
}
.field textarea{
  min-height: 120px;
  resize: vertical;
}
.form-actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  margin-top: 10px;
}
.note{ opacity:.8; font-size: 13px; }

/* =========================================================
   EXTRA: BUTTON TAP TARGETS (mobile)
========================================================= */
.btn-primary,
.btn-secondary,
.btn-outline{
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
