/* ==============================================================================
   AMAZING SMM - UNIVERSAL MULTI-DEVICE RESPONSIVE ENGINE (v3.5.0)
   Full cross-device compatibility:
   - Mobile Phones (320px - 480px: iPhone SE, 13/14/15/16 Pro, Galaxy, Pixel)
   - Large Phones & Foldables (481px - 767px)
   - Tablets Portrait (768px - 991px: iPad, Galaxy Tab)
   - Tablets Landscape & Small Laptops (992px - 1199px: iPad Pro, MacBooks)
   - Desktops & Large Monitors (1200px - 1920px)
   - Ultrawide & 4K (2560px+)
   ============================================================================== */

/* ==============================================================================
   1. CORE UNIVERSAL RESET & HARDWARE-ACCELERATED MOBILE POLISH
   ============================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100vw !important;
  overflow-x: clip !important;
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Inertia touch scrolling on all scrollable elements */
* {
  -webkit-overflow-scrolling: touch;
}

/* Prevent unwanted browser zoom on mobile form inputs */
@media (max-width: 991.98px) {
  input, select, textarea, .form-control, .form-select {
    font-size: 16px !important;
  }
}

/* Universal responsive media */
img, video, canvas, svg {
  max-width: 100% !important;
  height: auto;
}

/* Safe area insets for iPhone notch & dynamic island */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* ==============================================================================
   2. LANDING PAGE & PUBLIC INTERFACE RESPONSIVENESS
   ============================================================================== */

/* Header & Navigation Bar */
html body#outside .header {
  width: 100% !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

html body#outside .header .mh-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  min-height: 64px !important;
}

html body#outside .header .mh-logo {
  display: flex !important;
  align-items: center !important;
}

html body#outside .header .mh-logo img {
  max-height: 42px !important;
  width: auto !important;
}

/* Mobile Hamburger Menu Button */
@media (max-width: 991.98px) {
  html body#outside .header .mh-menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 2 !important;
  }
  
  html body#outside .header .mh-menu-btn .btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(40, 203, 105, 0.35) !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }

  html body#outside .header .mh-menu-btn .btn:active {
    transform: scale(0.95);
    background: rgba(40, 203, 105, 0.15) !important;
  }

  /* Expandable Mobile Navigation Drawer */
  html body#outside .header .mh-menu-wrapper {
    display: none !important;
    width: 100% !important;
    flex: 1 1 100% !important;
    order: 3 !important;
    padding: 16px 20px 20px !important;
    background: rgba(26, 26, 29, 0.98) !important;
    border: 1px solid rgba(40, 203, 105, 0.3) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    margin-top: 10px !important;
    margin-bottom: 12px !important;
  }

  body.menu-active html body#outside .header .mh-menu-wrapper,
  body.menu-active .header .mh-menu-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    animation: agMenuSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }

  html body#outside .header .mh-buttons {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  html body#outside .header .mh-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
    height: 48px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
  }
}

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

/* Hero Section Adaptation */
@media (max-width: 991.98px) {
  html body#outside .amz-hero {
    padding: 40px 0 24px !important;
  }

  html body#outside .amz-title {
    font-size: clamp(26px, 6vw, 42px) !important;
    line-height: 1.45 !important;
  }

  html body#outside .amz-sub {
    font-size: 14.5px !important;
    line-height: 1.8 !important;
    max-width: 94% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (max-width: 768px) {
  /* Prevent horizontal scrolling from floating animated beams/icons */
  html body#outside .amz-beam,
  html body#outside .amz-star,
  html body#outside .amz-ficon {
    display: none !important;
  }

  /* Quick Login Bar to Vertical Stack */
  html body#outside .amz-loginrow {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    padding: 16px !important;
    background: rgba(26, 26, 29, 0.85) !important;
    border: 1px solid rgba(40, 203, 105, 0.3) !important;
    border-radius: 20px !important;
    gap: 12px !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4) !important;
  }

  html body#outside .amz-loginrow input[name="username"],
  html body#outside .amz-loginrow input[name="password"],
  html body#outside .amz-loginrow .grow,
  html body#outside .amz-loginrow .go,
  html body#outside .amz-loginrow .amz-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 50px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
  }

  /* Hero Live Pill */
  html body#outside .amz-live-main {
    max-width: 96% !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    gap: 8px !important;
  }

  html body#outside .amz-live-main b {
    font-size: 14.5px !important;
  }

  /* Mini Pills */
  html body#outside .amz-minis {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  html body#outside .amz-minis span {
    font-size: 11.5px !important;
    padding: 6px 12px !important;
  }

  /* Grids and Cards */
  html body#outside .amz-cards8,
  html body#outside .amz-acc,
  html body#outside .amz-cmp,
  html body#outside .amz-faq2,
  html body#outside .amz-blog3,
  html body#outside .amz-group-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Payment Methods Grid */
  html body#outside .amz-paygrid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 10px !important;
  }

  /* Reviews Carousel */
  html body#outside .amz-tscroll {
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 16px !important;
    gap: 12px !important;
  }

  html body#outside .amz-tcard {
    min-width: min(280px, 80vw) !important;
    max-width: min(280px, 80vw) !important;
    scroll-snap-align: center !important;
  }

  /* CTA Banners */
  html body#outside .amz-bigcta,
  html body#outside .amz-cta {
    padding: 30px 18px !important;
    text-align: center !important;
  }

  html body#outside .amz-bigcta h2,
  html body#outside .amz-cta h2 {
    font-size: 22px !important;
  }

  /* Support Section */
  html body#outside .amz-support {
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body#outside .amz-support-ph {
    width: 100% !important;
    height: 190px !important;
    object-fit: cover !important;
  }

  html body#outside .amz-support-tx {
    padding: 22px 18px !important;
  }

  /* Footer safe space */
  html body#outside .footer {
    padding: 40px 15px calc(80px + var(--sab)) !important;
  }
}

@media (max-width: 480px) {
  html body#outside .amz-hero-stats,
  html body#outside .amz-rates {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  html body#outside .amz-hstat {
    padding: 8px 4px !important;
  }

  html body#outside .amz-hstat b {
    font-size: 13px !important;
  }

  html body#outside .amz-hstat span {
    font-size: 10.5px !important;
  }
}

@media (max-width: 360px) {
  html body#outside .amz-hero-stats,
  html body#outside .amz-rates {
    grid-template-columns: 1fr !important;
  }
}

/* ==============================================================================
   3. CLIENT USER PANEL RESPONSIVENESS (DASHBOARD, ORDERS, SERVICES, ETC.)
   ============================================================================== */

/* Layout Container */
.user-panel-layout {
  display: flex !important;
  width: 100% !important;
  min-height: 100vh !important;
}

.user-main-wrapper {
  flex: 1 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-x: hidden !important;
}

/* Sidebar Drawer on Tablets & Mobile (<= 1100px) */
@media (max-width: 1100px) {
  body.user-panel-body .user-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    inset-block: 0 !important;
    inset-inline-start: 0 !important;
    width: min(290px, 84vw) !important;
    min-width: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 10001 !important;
    transform: translateX(105%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.88) !important;
    background: #131313 !important;
  }

  [dir="ltr"] body.user-panel-body .user-sidebar {
    transform: translateX(-105%) !important;
  }

  body.user-panel-body .user-sidebar.active,
  html[dir="rtl"] body.user-panel-body .user-sidebar.active {
    transform: translateX(0) !important;
  }

  body.user-panel-body .user-sidebar-backdrop {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    z-index: 10000 !important;
  }

  body.user-panel-body .user-sidebar-backdrop.active {
    display: block !important;
  }

  /* Toggle button always visible and interactive */
  body.user-panel-body .up-collapse-btn,
  .user-topbar .user-sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #28cb69 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 18px rgba(40, 203, 105, 0.4) !important;
  }

  .user-content-area {
    padding: 16px 16px calc(75px + var(--sab)) !important;
  }
}

/* User Topbar Responsive Layout */
@media (max-width: 768px) {
  body.user-panel-body .user-topbar {
    padding: 10px 14px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .user-topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .user-topbar-pill {
    padding: 5px 10px !important;
    font-size: 11.5px !important;
    max-width: 190px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .user-topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-inline-start: auto !important;
  }

  .user-action-circle {
    width: 36px !important;
    height: 36px !important;
    font-size: 13px !important;
  }

  /* Search Bar stretches full width below pills */
  .user-topbar-search {
    width: 100% !important;
    flex: 1 1 100% !important;
    order: 10 !important;
    margin-top: 2px !important;
  }

  .user-topbar-search input {
    width: 100% !important;
    height: 40px !important;
    font-size: 14px !important;
    padding-inline-start: 38px !important;
    border-radius: 100px !important;
  }

  .user-topbar-search i {
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 13px !important;
  }
}

@media (max-width: 480px) {
  .user-topbar-pill span:first-child {
    display: none !important; /* Hide "Welcome:" label on tiny screens */
  }

  .user-topbar-pill {
    max-width: 160px !important;
  }
}

/* Top 4 Stat Cards Adaptation */
@media (max-width: 1199.98px) {
  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

@media (max-width: 640px) {
  .user-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .stat-card-status,
  .stat-card-points,
  .stat-card-white,
  .user-stat-card {
    padding: 14px 12px !important;
    border-radius: 14px !important;
  }

  .stat-card-white .white-val,
  .points-val {
    font-size: 17px !important;
  }

  .stat-card-white .stat-icon-3d img,
  .stat-card-white .stat-icon-3d i {
    width: 44px !important;
    height: 44px !important;
    font-size: 30px !important;
  }

  .up-level-badge {
    font-size: 10px !important;
    padding: 2px 10px !important;
    top: -10px !important;
  }

  .status-title {
    font-size: 15px !important;
  }
}

@media (max-width: 380px) {
  .user-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Orders Filter Bar (Horizontal Swipeable Carousel on Mobile) */
@media (max-width: 768px) {
  .orders-filter-bar,
  .platform-filter-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    margin-bottom: 16px !important;
  }

  .orders-filter-bar::-webkit-scrollbar,
  .platform-filter-bar::-webkit-scrollbar {
    display: none !important;
  }

  .filter-pill-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 7px 15px !important;
  }
}

/* Universal Data Tables */
.table-responsive {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-radius: 14px !important;
}

@media (max-width: 768px) {
  .table th,
  .table td {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
  }

  .service-id-badge {
    padding: 4px 8px !important;
    font-size: 11px !important;
    min-width: 40px !important;
  }
}

/* Services Catalog List (services.php) */
@media (max-width: 768px) {
  .service-category-head {
    padding: 12px 16px !important;
    border-radius: 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .service-category-head h2 {
    font-size: 14.5px !important;
  }

  .service-item {
    padding: 12px 14px !important;
    border-radius: 14px !important;
    margin-bottom: 8px !important;
  }

  .services-title a .ss-name {
    font-size: 13.5px !important;
    line-height: 1.6 !important;
  }

  .sib-first {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 8px !important;
  }

  .sib-first span {
    font-size: 11px !important;
    padding: 3px 8px !important;
  }

  .services-item-bottom {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-top: 10px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .services-rate {
    font-size: 13px !important;
    padding: 4px 10px !important;
  }

  .services-item-bottom .btn {
    padding: 6px 14px !important;
    font-size: 12px !important;
  }
}

/* ==============================================================================
   4. CLIENT MOBILE APP BOTTOM NAVIGATION BAR
   ============================================================================== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: calc(60px + var(--sab)) !important;
    padding-bottom: var(--sab) !important;
    background: rgba(19, 19, 21, 0.96) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border-top: 1px solid rgba(40, 203, 105, 0.3) !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.65) !important;
    z-index: 9999 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .bottom-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    color: #8a8a93 !important;
    text-decoration: none !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    background: none !important;
    border: none !important;
    padding: 6px 8px !important;
    cursor: pointer !important;
    flex: 1 !important;
    max-width: 75px !important;
    transition: color 0.15s ease, transform 0.15s ease !important;
  }

  .bottom-nav-item i {
    font-size: 17px !important;
    transition: transform 0.15s ease !important;
  }

  .bottom-nav-item.active,
  .bottom-nav-item:active {
    color: #28cb69 !important;
  }

  .bottom-nav-item.active i {
    transform: scale(1.12);
    color: #28cb69 !important;
  }

  /* Center Elevated Order Button */
  .bottom-nav-center-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    margin-top: -18px !important;
    flex-shrink: 0 !important;
  }

  .center-btn-inner {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #28cb69 0%, #0fac4e 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 19px !important;
    box-shadow: 0 8px 24px rgba(40, 203, 105, 0.55), inset 0 1px 0 rgba(255,255,255,0.4) !important;
    border: 3px solid #131313 !important;
    transition: transform 0.18s ease !important;
  }

  .bottom-nav-center-btn:active .center-btn-inner {
    transform: scale(0.92);
  }

  /* Safe padding so content is never hidden behind the bottom bar */
  body.user-panel-body .user-main-wrapper {
    padding-bottom: calc(75px + var(--sab)) !important;
  }

  /* Float WhatsApp & Telegram above bottom nav */
  .floating-contact-btn,
  .whatsapp-floating-btn,
  .telegram-floating-btn {
    bottom: calc(75px + var(--sab)) !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
  }
}

/* ==============================================================================
   5. ADMIN PANEL RESPONSIVENESS
   ============================================================================== */
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    inset-block: 0 !important;
    inset-inline-start: 0 !important;
    width: min(290px, 85vw) !important;
    height: 100vh !important;
    z-index: 10001 !important;
    transform: translateX(105%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  [dir="ltr"] .admin-sidebar {
    transform: translateX(-105%) !important;
  }

  .admin-sidebar.active,
  html[dir="rtl"] .admin-sidebar.active {
    transform: translateX(0) !important;
  }

  .admin-drawer-backdrop {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
  }

  .admin-drawer-backdrop.active {
    display: block !important;
  }

  .admin-main {
    margin-inline-start: 0 !important;
    width: 100% !important;
    padding-bottom: calc(75px + var(--sab)) !important;
  }

  .admin-mobile-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(40, 203, 105, 0.3) !important;
    color: #ffffff !important;
    cursor: pointer !important;
  }

  .admin-header {
    padding: 10px 16px !important;
  }

  .admin-header-page-title {
    font-size: 15px !important;
    max-width: 180px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 12px !important;
  }
}

/* ==============================================================================
   6. AUTHENTICATION PAGES RESPONSIVENESS (LOGIN, REGISTER, 2FA)
   ============================================================================== */
@media (max-width: 576px) {
  .login-card-container,
  .auth-card-wrapper {
    width: 94% !important;
    max-width: 440px !important;
    padding: 24px 18px !important;
    margin: 15px auto !important;
    border-radius: 20px !important;
  }

  #login-sec h1.login-title,
  .auth-title {
    font-size: 26px !important;
  }

  #login-sec p.login-sub,
  .auth-sub {
    font-size: 14px !important;
    margin-bottom: 24px !important;
  }

  .form-group.v2 .form-control {
    height: 50px !important;
    font-size: 15px !important;
    border-radius: 14px !important;
  }

  .input-icon {
    width: 38px !important;
    height: 38px !important;
  }
}

/* ==============================================================================
   7. MODAL DIALOGS RESPONSIVENESS
   ============================================================================== */
.modal-dialog {
  max-width: min(540px, 94vw) !important;
  margin: 20px auto !important;
}

@media (max-width: 576px) {
  .modal-content {
    border-radius: 18px !important;
    padding: 16px !important;
  }

  .modal-header h5,
  .modal-title {
    font-size: 16px !important;
  }
}
