/* Prevent horizontal overflow globally */
* {
  max-width: 100%;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
}

/* ---------- Global Styles ---------- */
a:focus, a:hover { 
  outline: none; 
  text-decoration: none; 
}
a { 
  text-decoration: none; 
}
img { 
  max-width: 100%; 
  height: auto; 
}
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 15px;
  font-weight: 600;
  color: #373737;
  font-family: "Montserrat", sans-serif;
}
body {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden; /* Prevent horizontal overflow globally */
  max-width: 100vw; /* Ensure body doesn't exceed viewport width */
  box-sizing: border-box;
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  top: 0; left: 0; right: 0; 
  width: 100%; 
  height: 100%;
  background-color: #fff;
  z-index: 99999999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

html.preloader-active,
body.preloader-active {
  overflow: hidden !important;
  height: 100% !important;
}

.preloader-spinner {
  position: absolute;
  width: 50px; 
  height: 50px;
  top: 50%; 
  left: 50%;
  margin-left: -25px; 
  margin-top: -25px;
  animation: preload-spin infinite 0.95s linear;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1338BE;
  border-radius: 50%;
}

@keyframes preload-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------- Hero Section ---------- */
.hero-section {
  background-image: url('/images/main.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  position: relative;
  overflow: hidden;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#particles-js {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
}

.particles-js-canvas-el {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 1;
  pointer-events: auto;
}

#particles-js canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.hero-section .container {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section .row {
  position: relative;
  z-index: 10;
  width: 100%;
  justify-content: center;
}

.hero-content {
  position: relative;
  z-index: 10 !important;
  text-align: center;
  width: 100%;
}

.hero-content h1,
.hero-content p {
  position: relative;
  z-index: 10 !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  color: white;
  text-align: center;
}

.hero-content .d-flex {
  position: relative;
  z-index: 1;
}

/* Hero Content Animation */
.hero-content {
  opacity: 0;
  transform: translateY(50px);
  transition: all 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-content.hero-content-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- TradingView Widget Enhancements ---------- */

/* TradingView Widget Responsive Container */
.tradingview-widget-container {
  position: relative;
  overflow: hidden;
  border-radius: 0.375rem;
  background: #ffffff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  max-width: 100%;
  box-sizing: border-box;
}

.tradingview-widget-container > div {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 300px;
}

.tradingview-widget-container iframe {
  border-radius: 0.375rem;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Mobile TradingView Optimizations */
@media (max-width: 767.98px) {
  .tradingview-widget-container {
    margin: 0;
    border-radius: 0.25rem;
    width: 100%;
    padding: 0.75rem !important; /* Reduce padding on mobile */
    overflow-x: hidden; /* Ensure no horizontal overflow */
    overflow: hidden;
  }

  .tradingview-widget-container > div {
    min-height: 280px;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
  }

  /* Hide complex chart elements on very small screens */
  .tradingview-widget-container iframe {
    transform: scale(0.95);
    transform-origin: top center;
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Constrain TradingView widget internal elements */
  .tradingview-widget-container * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Touch device optimizations for TradingView */
@media (hover: none) and (pointer: coarse) {
  .tradingview-widget-container iframe {
    pointer-events: auto;
  }
}

/* TradingView Loading States */
.tradingview-widget-container:empty::before {
  content: "Loading chart...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #6c757d;
  font-size: 1rem;
  z-index: 1;
}

/* Ensure proper aspect ratio maintenance */
.tradingview-widget-container {
  aspect-ratio: 16 / 9;
  min-height: 300px;
}

@media (max-width: 767.98px) {
  .tradingview-widget-container {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Notification Widget ---------- */
.mgm {
  border-radius: 7px;
  position: fixed;
  z-index: 90;
  bottom: 80px;
  right: 50px;
  background: #f2eeee;
  padding: 20px 27px;
  box-shadow: 0px 5px 13px 0px rgba(0,0,0,0.3);
}

.mgm .txt { 
  color: black; 
}

.mgm a {
  font-weight: 700;
  display: block;
  color: green;
}

/* ---------- Utility Classes ---------- */
h2 span { 
  color: #1338BE; 
}

.text-light-50 { 
  opacity: 0.7; 
}

/* ---------- Button Styles ---------- */
.btn {
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(102, 126, 234, 0.6);
  color: white;
  text-decoration: none;
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

.btn-outline-primary {
  color: #667eea;
  border: 2px solid #667eea;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background-color: #667eea;
  border-color: #667eea;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(102, 126, 234, 0.4);
}

.btn-outline-light {
  border: 2px solid white;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-light:hover {
  background-color: white;
  color: #667eea;
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(255, 255, 255, 0.3);
}

.btn-lg {
  padding: 12px 30px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* Auth Links in Header */
.auth-links .btn {
  margin: 0 5px;
  font-size: 0.95rem;
}

.auth-links .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.7);
  color: rgba(255, 255, 255, 0.9);
}

.auth-links .btn-outline-light:hover {
  border-color: white;
  color: white;
  background-color: transparent;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.auth-links .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-links .btn-primary:hover {
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

/* ---------- Responsive Styles ---------- */

/* Extra Small Devices (phones, <576px) */
@media (max-width: 575.98px) {
  /* Global Mobile Styles */
  body {
    font-size: 14px;
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Prevent any element from causing horizontal overflow */
  * {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Ensure containers don't overflow */
  .container, .container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100vw !important;
  }

  h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
  }

  /* Hero Section Mobile */
  .hero-section {
    min-height: 450px;
    padding: 80px 0 60px;
  }

  .hero-content h1 {
    font-size: 1.75rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.2;
  }

  .hero-content .lead {
    font-size: 1.1rem !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.4;
  }

  .hero-content .fs-5 {
    font-size: 0.95rem !important;
    margin-bottom: 2rem !important;
    line-height: 1.5;
  }

  .hero-content .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    margin: 0.25rem;
  }

  /* Section Spacing Mobile */
  .py-5, .py-md-6 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* Container Mobile */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Navigation Mobile */
  .navbar-brand img {
    max-height: 35px !important;
  }

  .navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
  }

  /* Cards Mobile */
  .card, .pricing-card, .service-card, .testimonial-card, .investor-card, .stat-card {
    margin-bottom: 1rem;
  }

  /* Process Cards Mobile */
  .process-card {
    text-align: center;
    padding: 1.5rem 1rem;
  }

  .process-card img {
    max-height: 60px !important;
    margin-bottom: 1rem;
  }

  /* Service Icons Mobile */
  .service-icon {
    width: 60px !important;
    height: 60px !important;
  }

  .service-icon i {
    font-size: 1.5rem !important;
  }

  /* Statistics Mobile */
  .stat-card i {
    font-size: 2rem !important;
  }

  .stat-card h3 {
    font-size: 1.5rem;
  }

  /* Footer Mobile */
  .footer {
    padding: 20px 0;
    text-align: center;
  }

  .footer h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  /* Notification Widget Mobile */
  .mgm {
    bottom: 15px;
    right: 15px;
    left: 15px;
    width: auto;
    padding: 12px 15px;
    max-width: calc(100vw - 30px);
    font-size: 0.9rem;
  }

  /* CTA Section Mobile */
  .cta-section .display-5 {
    font-size: 1.8rem;
  }

  .cta-section .fs-5 {
    font-size: 1rem;
  }

  .cta-section .btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    width: 100%;
    margin-top: 1rem;
  }

  /* TradingView Charts Mobile */
  .tradingview-widget-container {
    height: 350px !important;
    padding: 1rem !important;
  }

  .tradingview-widget-container > div {
    min-height: 300px;
  }

  /* Payment Methods Mobile */
  .payment-method i {
    font-size: 2rem !important;
  }
}

/* Small Devices (phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  /* Hero Section Small */
  .hero-section {
    min-height: 500px;
    padding: 100px 0 80px;
  }

  .hero-content h1 {
    font-size: 2.2rem !important;
  }

  .hero-content .lead {
    font-size: 1.2rem !important;
  }

  .hero-content .fs-5 {
    font-size: 1rem !important;
  }

  /* Navigation Small */
  .navbar-brand img {
    max-height: 40px !important;
  }

  /* Cards Small */
  .process-card img {
    max-height: 70px !important;
  }

  /* TradingView Charts Small */
  .tradingview-widget-container {
    height: 400px !important;
  }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Hero Section Tablet */
  .hero-section {
    min-height: 550px;
  }

  .hero-content h1 {
    font-size: 2.8rem !important;
  }

  .hero-content .lead {
    font-size: 1.3rem !important;
  }

  .hero-content .fs-5 {
    font-size: 1.1rem !important;
  }

  /* Navigation Tablet */
  .navbar-brand img {
    max-height: 45px !important;
  }

  /* Notification Widget Tablet */
  .mgm {
    bottom: 30px;
    right: 30px;
    max-width: 300px;
  }

  /* TradingView Charts Tablet */
  .tradingview-widget-container {
    height: 450px !important;
  }

  /* CTA Section Tablet */
  .cta-section .display-5 {
    font-size: 2.5rem;
  }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* Hero Section Desktop */
  .hero-section {
    min-height: 600px;
  }

  .hero-content h1 {
    font-size: 3.2rem !important;
  }

  .hero-content .lead {
    font-size: 1.4rem !important;
  }

  .hero-content .fs-5 {
    font-size: 1.2rem !important;
  }

  /* TradingView Charts Large */
  .tradingview-widget-container {
    height: 500px !important;
  }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  /* Hero Section XL */
  .hero-section {
    min-height: 650px;
  }

  .hero-content h1 {
    font-size: 3.5rem !important;
  }

  .hero-content .lead {
    font-size: 1.5rem !important;
  }

  .hero-content .fs-5 {
    font-size: 1.25rem !important;
  }

  /* TradingView Charts XL */
  .tradingview-widget-container {
    height: 550px !important;
  }

  /* CTA Section XL */
  .cta-section .display-5 {
    font-size: 3rem;
  }
}

/* Ultra-wide screens */
@media (min-width: 1400px) {
  .hero-content h1 {
    font-size: 4rem !important;
  }

  .container {
    max-width: 1320px;
  }
}

/* Additional Responsive Improvements */

/* About Section Responsive */
@media (max-width: 991.98px) {
  .about-section .row {
    text-align: center;
  }

  .about-content {
    margin-top: 2rem;
  }

  .about-content h2 {
    font-size: 2rem;
  }

  .about-content .fs-5 {
    font-size: 1rem;
  }
}

/* Support Section Responsive */
@media (max-width: 767.98px) {
  .support-section .row {
    text-align: center;
  }

  .support-card {
    margin-bottom: 2rem;
  }

  .referral-card {
    margin-top: 2rem;
  }
}

/* Legitimacy Section Responsive */
.legitimacy-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.legitimacy-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

.legitimacy-card-image-wrapper {
  width: 100%;
  overflow: hidden;
  background-color: #f8f9fa;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legitimacy-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.legitimacy-card-image:hover {
  transform: scale(1.05);
}

.legitimacy-card p {
  flex-grow: 1;
}

.legitimacy-card .btn {
  width: 100%;
  margin-top: auto;
}

/* Small Text Responsive */
.small-text-responsive {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Mobile (max-width: 575.98px) */
@media (max-width: 575.98px) {
  .legitimacy-card {
    margin-bottom: 1rem;
  }

  .legitimacy-card-image-wrapper {
    aspect-ratio: 16 / 9;
    min-height: 150px;
  }

  .legitimacy-card p {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .p-3 {
    padding: 0.75rem !important;
  }

  .legitimacy-card .fw-bold {
    font-size: 1rem !important;
  }
}

/* Small devices (576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .legitimacy-card {
    margin-bottom: 1rem;
  }

  .legitimacy-card-image-wrapper {
    aspect-ratio: 16 / 9;
    min-height: 180px;
  }

  .legitimacy-card p {
    font-size: 0.9rem;
  }
}

/* Tablets and above (768px+) */
@media (min-width: 768px) {
  .legitimacy-card-image-wrapper {
    aspect-ratio: 16 / 10;
    min-height: 220px;
  }

  .legitimacy-card p {
    font-size: 0.95rem;
  }
}

/* Medium devices (992px+) */
@media (min-width: 992px) {
  .legitimacy-card-image-wrapper {
    min-height: 250px;
  }
}

/* Large devices (1200px+) */
@media (min-width: 1200px) {
  .legitimacy-card-image-wrapper {
    aspect-ratio: 16 / 10;
    min-height: 280px;
  }

  .legitimacy-card:hover {
    transform: translateY(-8px);
  }
}

/* Investment Plans Responsive */
@media (max-width: 991.98px) {
  .pricing-card {
    margin-bottom: 2rem;
  }

  .pricing-card .badge {
    position: static !important;
    display: block;
    margin-bottom: 1rem;
    transform: none !important;
  }
}

/* Testimonials Responsive */
@media (max-width: 767.98px) {
  .testimonial-card img {
    width: 40px !important;
    height: 40px !important;
  }
}

/* Statistics Counter Animation */
.counter {
  font-weight: bold;
  color: #667eea;
}

/* WOW.js Mobile Optimization */
@media (max-width: 767.98px) {
  .wow {
    animation-duration: 1s !important;
    animation-delay: 0.1s !important;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none !important;
  }

  .service-card:hover,
  .pricing-card:hover,
  .testimonial-card:hover {
    transform: none !important;
  }
}

/* Navigation hover style without text movement */
@keyframes rippleGlow {
  0% {
    text-shadow: 0 0 0 rgba(19, 56, 190, 0);
  }
  50% {
    text-shadow: 0 0 8px rgba(19, 56, 190, 0.2);
  }
  100% {
    text-shadow: 0 0 0 rgba(19, 56, 190, 0);
  }
}

.navbar-nav .nav-link {
  position: relative;
  transition: color 0.25s ease;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 30px;
  left: 50%;
  width: 5px;
  height: 5px;
  background: #1338BE;
  border-radius: 50%;
  opacity: 0;
  transform: translateX(-50%);
  transition:
    width 0.5s ease,
    height 0.4s ease 0.05s,
    border-radius 0.4s ease 0.05s,
    bottom 0.5s ease 0.05s,
    opacity 0.25s ease 0.1s;
}

.navbar-nav .nav-link:hover {
  color: #1338BE !important;
  font-weight: 500;
}

.navbar-nav .nav-link:hover::after {
  width: 40px;
  height: 3px;
  border-radius: 0;
  bottom: 0px;
  opacity: 1;
}

/* High DPI Screen Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-section {
    background-attachment: scroll; /* Prevent background jitter on iOS */
  }
}

/* ---------- Modal Responsive Styles ---------- */
.modal-dialog {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 0.5rem;
}

.modal-content {
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  flex-shrink: 0;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  min-height: 200px;
}

.modal-body img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: auto;
}

/* Mobile Modals (max-width: 575.98px) */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0.5rem;
    min-height: calc(100vh - 1rem);
  }

  .modal-dialog.modal-dialog-centered {
    min-height: 100vh;
  }

  .modal-content {
    max-height: calc(100vh - 1rem);
    border-radius: 0.5rem;
  }

  .modal-header {
    padding: 0.75rem;
  }

  .modal-header .modal-title {
    font-size: 1rem;
  }

  .modal-body {
    padding: 0.75rem;
    min-height: 200px;
    max-height: calc(100vh - 120px);
  }

  .modal-body img {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    width: auto;
    height: auto;
  }
}

/* Small Devices (576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .modal-dialog {
    margin: 0.75rem;
    min-height: calc(100vh - 1.5rem);
  }

  .modal-content {
    max-height: calc(100vh - 1.5rem);
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
    max-height: calc(100vh - 100px);
  }

  .modal-body img {
    max-height: calc(100vh - 140px);
  }
}

/* Tablets and larger (768px+) */
@media (min-width: 768px) {
  .modal-dialog {
    margin: 1rem auto;
    min-height: unset;
  }

  .modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: 100vh;
  }

  .modal-dialog-lg {
    max-width: 900px;
  }

  .modal-content {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  .modal-header {
    padding: 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
    max-height: calc(100vh - 160px);
  }

  .modal-body img {
    max-height: calc(100vh - 200px);
  }
}

/* Large Desktops (1200px+) */
@media (min-width: 1200px) {
  .modal-dialog-lg {
    max-width: 1000px;
  }

  .modal-body img {
    max-height: 75vh;
  }
}

/* Prevent scrolling when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Scrollbar styling for modal body */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}

/* Print Styles */
@media print {
  .hero-section,
  .ticker-section,
  .market-chart-section,
  .tradingview-widget-container,
  .mgm {
    display: none !important;
  }

  .navbar,
  .footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
  }
}

