/* ==========================================================================
   TOPSTAR GROUP - MASTER RESPONSIVE STYLESHEET
   Comprehensive Breakpoints for Mobile, Tablet, Laptop, and 4K Displays
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Global Viewport & Horizontal Overflow Shield
   -------------------------------------------------------------------------- */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, video, iframe, canvas, svg {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6, p, span, a, strong, b, div {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* --------------------------------------------------------------------------
   1. Large Laptops & Desktops (max-width: 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .container {
    max-width: 1120px;
    padding: 0 1.5rem;
  }

  .nav-mega-menu {
    width: 780px;
  }

  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-heading {
    font-size: 3rem;
  }

  .hero-grid {
    gap: 2rem;
  }

  .profile-hero-grid {
    gap: 2rem;
  }

  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   2. Tablets and Medium Viewports (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  /* Top Utility Bar */
  .top-bar {
    display: none !important; /* Hide top utility bar on tablet/mobile for clean compact header */
  }

  .main-nav-bar {
    padding: 0.65rem 0;
  }

  .nav-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Drawer Navigation Menu */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #071326;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 1.5rem 2rem 1.5rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    z-index: 1050;
    gap: 0.5rem;
  }

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

  .nav-item {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
  }

  .nav-dropdown, .nav-mega-menu {
    position: static;
    transform: none !important;
    width: 100% !important;
    opacity: 1;
    visibility: visible;
    display: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.5rem 0.75rem 1rem;
    margin-top: 0.3rem;
  }

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

  .mega-menu-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
  }

  .mobile-menu-toggle,
  .mobile-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1.15rem;
    cursor: pointer;
  }

  /* Hero & Page Banners */
  .hero-section {
    padding-top: 105px;
    min-height: auto;
    padding-bottom: 3.5rem;
  }

  .page-hero,
  .profile-hero {
    padding-top: 105px !important;
    padding-bottom: 3.5rem !important;
    min-height: auto;
  }

  .hero-grid,
  .profile-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .hero-heading,
  .profile-hero-title {
    font-size: 2.4rem !important;
    line-height: 1.2 !important;
  }

  .hero-title-gold,
  .profile-hero-gold {
    font-size: 1.7rem !important;
  }

  .hero-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Grid layouts */
  .overview-grid, 
  .network-grid, 
  .contact-layout-grid, 
  .detail-layout-grid,
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .overview-float-card {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: 1.5rem;
    max-width: 100%;
  }

  .growth-engines-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gov-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .board-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .exec-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline::before,
  .timeline-track::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 50px;
    padding-right: 0;
    text-align: left !important;
  }

  .timeline-item.right,
  .timeline-item:nth-child(even) {
    left: 0;
  }

  .timeline-dot {
    left: 11px !important;
    right: auto !important;
  }

  .cta-inner {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .cta-text p {
    margin: 0 auto;
  }

  .cta-actions {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   3. Small Screens and Smartphones (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .container {
    padding: 0 1.2rem;
  }

  .section-padding {
    padding: 3rem 0;
  }

  .section-title {
    font-size: 1.75rem !important;
  }

  .page-hero {
    padding: 95px 0 3rem 0 !important;
  }

  .profile-hero {
    padding: 95px 0 3rem 0 !important;
  }

  .page-hero-title,
  .profile-hero-title {
    font-size: 1.85rem !important;
    line-height: 1.22 !important;
    letter-spacing: -0.5px !important;
  }

  .hero-title-gold,
  .profile-hero-gold {
    font-size: 1.35rem !important;
  }

  .page-hero-subtitle,
  .profile-hero-desc,
  .hero-desc {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
  }

  .hero-heading {
    font-size: 1.85rem !important;
    line-height: 1.22 !important;
  }

  .hero-tag,
  .profile-hero-badge,
  .section-badge {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.8rem !important;
    letter-spacing: 0.5px !important;
    max-width: 100% !important;
  }

  .hero-buttons,
  .profile-hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .hero-buttons .btn,
  .profile-hero-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.75rem 1.2rem !important;
    font-size: 0.92rem !important;
  }

  .hero-trust-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }

  .trust-item {
    width: 100% !important;
    justify-content: flex-start !important;
    font-size: 0.75rem !important;
  }

  .hero-metrics-bar {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .hero-metric-card {
    padding: 1rem !important;
  }

  .hero-ecosystem-card,
  .profile-hero-card {
    padding: 1.25rem !important;
  }

  .eco-company-chips {
    grid-template-columns: 1fr !important;
  }

  .profile-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }

  .profile-stat-box {
    padding: 0.9rem !important;
  }

  .profile-stat-num {
    font-size: 1.6rem !important;
  }

  .form-grid-2 {
    grid-template-columns: 1fr !important;
  }

  .detail-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .detail-services-list {
    grid-template-columns: 1fr;
  }

  .gov-pillars-grid {
    grid-template-columns: 1fr !important;
  }

  .board-grid {
    grid-template-columns: 1fr;
  }

  .exec-grid {
    grid-template-columns: 1fr;
  }

  .multiplier-grid {
    grid-template-columns: 1fr;
  }

  .company-grid {
    grid-template-columns: 1fr;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .sector-nav-tabs {
    gap: 0.4rem;
  }

  .sector-pill-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }

  /* Overview Managing Director & Leadership CTA Card on Mobile */
  .overview-leader-info {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.2rem !important;
  }

  .overview-leader-profile {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
  }

  .overview-leader-btn {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: center !important;
    padding: 0.75rem 1.2rem !important;
    font-size: 0.92rem !important;
    text-align: center !important;
  }

  /* AI Chatbot mobile adjustment */
  .ai-chat-window {
    width: calc(100vw - 20px) !important;
    right: 10px !important;
    bottom: 85px !important;
    max-height: 80vh !important;
  }
}

/* --------------------------------------------------------------------------
   4. Extra Small Phones (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container {
    padding: 0 0.85rem;
  }

  .brand-logo-name {
    font-size: 1.05rem;
  }

  .brand-logo-sub {
    font-size: 0.6rem;
  }

  .brand-logo-img {
    height: 34px;
    padding: 2px 4px;
  }

  .page-hero-title,
  .profile-hero-title,
  .hero-heading {
    font-size: 1.65rem !important;
    line-height: 1.2 !important;
  }

  .hero-title-gold,
  .profile-hero-gold {
    font-size: 1.25rem !important;
  }

  .profile-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .profile-stat-box {
    padding: 0.75rem 0.6rem !important;
  }

  .profile-stat-num {
    font-size: 1.4rem !important;
  }

  .profile-stat-label {
    font-size: 0.7rem !important;
  }

  .gov-pillar-card {
    padding: 1.5rem 1rem;
  }

  .gov-avatar-circle,
  .gov-avatar-img {
    width: 120px !important;
    height: 120px !important;
  }

  .board-avatar,
  .board-avatar-img {
    width: 75px !important;
    height: 75px !important;
  }

  .modal-dialog {
    margin: 0.5rem;
    padding: 1.25rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .tracker-input {
    font-size: 0.85rem;
    padding: 0.65rem 0.8rem;
  }
}
