/**
 * iOS 27 Futuristic Theme - RandomVIP1K.Shop (v3.2 Pro Max Harmony Edition)
 * Features: Clean Light/Dark Contrast, Full Vietnamese Typography, Responsive SMM Select2
 */

/* ==========================================================================
   0. NỀN TẢNG MÀU SẮC LIGHT / DARK CHUẨN UI/UX PRO MAX (60-30-10)
   ========================================================================== */
body.color-light,
body:not(.dark) {
  background-color: #f1f5f9;
  color: #0f172a;
}

body.dark {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

body.dark .wrapper,
body.dark .content-page {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

body.dark .iq-top-navbar,
body.dark .iq-footer {
  background: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
  color: #e2e8f0 !important;
}

/* ==========================================================================
   1. iOS ELASTIC SPRING BUTTONS & CONTROLS
   ========================================================================== */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"],
.pwa-btn-install,
.pwa-install-trigger-btn,
.custom-switch label,
.page-link,
.badge-action {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.25s ease,
              filter 0.2s ease,
              background-color 0.2s ease !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  button:hover,
  .btn:hover,
  a.btn:hover,
  .pwa-install-trigger-btn:hover {
    transform: scale(1.02) translateY(-1px);
    filter: brightness(1.04);
  }

  button:active,
  .btn:active,
  a.btn:active,
  input[type="submit"]:active,
  input[type="button"]:active,
  .pwa-btn-install:active,
  .pwa-install-trigger-btn:active,
  .page-link:active {
    transform: scale(0.96) !important;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
}

/* ==========================================================================
   2. CARDS & CUSTOM PANELS (Tương Phản Rõ Nét Ở Cả Light & Dark Mode)
   ========================================================================== */
.card:not(.lq-glass-card):not(.hack-card):not(.dark-credentials-card),
.modal-content:not(.modal-guide-content),
.iq-card {
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.06) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
  position: relative;
}

body.dark .card:not(.lq-glass-card),
body.dark .modal-content,
body.dark .iq-card,
body.dark .smm-card,
body.dark .tt-card,
body.dark .ff-card,
body.dark .hosting-card,
body.dark .checkout-card,
body.dark .dvc-card,
body.dark .manage-card,
body.dark .action-card,
body.dark .transfer-card,
body.dark .domain-card-v2,
body.dark .checkout-inline-card,
body.dark .result-card-available,
body.dark .result-card-taken,
body.dark .prem-card,
body.dark .package-select-card,
body.dark .vn-plan-card,
body.dark .payment-box-wrap,
body.dark .shadow-showcase,
body.dark .seo-faq-card {
  background: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.45) !important;
  color: #f1f5f9 !important;
}

/* Các thẻ con bên trong trang dịch vụ khi bật Dark Mode */
body.dark .tt-server-card,
body.dark .ff-server-card,
body.dark .tt-price-box,
body.dark .checkout-summary-box,
body.dark .total-payment-box,
body.dark .info-cell,
body.dark .month-pill,
body.dark .smm-search-dropdown,
body.dark .tld-pill-item,
body.dark .tt-chip-btn,
body.dark .ff-chip-btn {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #e2e8f0 !important;
}

body.dark .tt-server-card.active {
  background: rgba(254, 44, 85, 0.14) !important;
  border-color: #fe2c55 !important;
}

body.dark .ff-server-card.active {
  background: rgba(220, 38, 38, 0.16) !important;
  border-color: #ef4444 !important;
}

/* Chữ tiêu đề & nội dung chuẩn độ tương phản WCAG AA trong Dark Mode */
body.dark .text-dark:not(.btn):not(.badge),
body.dark .smm-label,
body.dark .tt-label,
body.dark .ff-label,
body.dark .smm-opt-name,
body.dark .smm-sel-name,
body.dark .smm-stat-value:not(.text-success):not(.text-danger),
body.dark .pkg-title,
body.dark .prem-title,
body.dark .manage-card-title,
body.dark .dvc-card-title,
body.dark .action-card-title,
body.dark .info-cell-val,
body.dark .spec-val,
body.dark .card-title,
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark h6 {
  color: #f8fafc !important;
}

body.dark .text-muted,
body.dark .text-secondary,
body.dark .smm-switch-row,
body.dark .smm-opt-unit,
body.dark .prem-desc,
body.dark .pkg-features li,
body.dark .spec-name,
body.dark .info-cell-label {
  color: #94a3b8 !important;
}

body.dark .smm-side-info-row,
body.dark .ff-side-row,
body.dark .smm-search-item,
body.dark .spec-item,
body.dark .smm-dashed-sep,
body.dark .border-top,
body.dark .border-bottom {
  border-color: rgba(148, 163, 184, 0.16) !important;
}

body.dark .smm-search-item:hover {
  background: rgba(56, 189, 248, 0.12) !important;
}

body.dark .badge-light {
  background: rgba(15, 23, 42, 0.9) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #e2e8f0 !important;
}

body.dark .smm-side-desc-box,
body.dark .ff-guide-box {
  background: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.28) !important;
  color: #bae6fd !important;
}

@keyframes iosAuraGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
   3. BẢNG BIỂU & Ô NHẬP LIỆU (Rõ Viền, Không Bị Trắng Trên Trắng)
   ========================================================================== */
.table {
  border-collapse: separate !important;
  border-spacing: 0 4px !important;
}

.table tbody tr {
  background: #ffffff !important;
  border-radius: 12px;
  transition: background-color 0.2s ease;
}

body.dark .table tbody tr {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

body.dark .table tbody td {
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08) !important;
}

body.dark .table tbody tr:hover {
  background: rgba(59, 130, 246, 0.16) !important;
}

/* Input Fields & Textarea */
.form-control:not(.lq-input),
.form-select,
input.form-control:not(.lq-input),
textarea.form-control {
  background: #f8fafc !important;
  border-radius: 12px !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

.smm-paste-btn {
  background: #f1f5f9 !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #334155 !important;
  border-radius: 0 12px 12px 0 !important;
}

#url.form-control {
  border-radius: 12px 0 0 12px !important;
}

body.dark .form-control:not(.lq-input),
body.dark .form-select,
body.dark input.form-control:not(.lq-input),
body.dark textarea.form-control,
body.dark .smm-paste-btn {
  background: #0f172a !important;
  border: 1.5px solid rgba(148, 163, 184, 0.28) !important;
  color: #f8fafc !important;
}

.form-control:not(.lq-input):focus,
.form-select:focus,
input.form-control:not(.lq-input):focus,
textarea.form-control:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

body.dark .form-control:not(.lq-input):focus,
body.dark .form-select:focus,
body.dark input.form-control:not(.lq-input):focus,
body.dark textarea.form-control:focus {
  background: #0f172a !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

/* ==========================================================================
   4. SIDEBAR MENU & SUBMENU
   ========================================================================== */
.sidebar-default .iq-sidebar-menu .side-menu > li > a {
  border-radius: 12px !important;
  transition: background 0.25s ease, transform 0.25s ease !important;
  color: #ffffff !important;
}

.sidebar-default .iq-sidebar-menu .side-menu > li.active > a,
.sidebar-default .iq-sidebar-menu .side-menu > li > a[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14) !important;
  border-radius: 14px !important;
}

body.dark .sidebar-default .iq-sidebar-menu .side-menu > li.active > a,
body.dark .sidebar-default .iq-sidebar-menu .side-menu > li > a[aria-expanded="true"] {
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.iq-sidebar-menu .side-menu .submenu,
.iq-sidebar-menu .side-menu .submenu.collapsing,
.iq-sidebar-menu .side-menu .submenu.collapse.show {
  list-style: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 0 4px 14px !important;
  margin: 0 !important;
}

.iq-sidebar-menu .side-menu .submenu li {
  margin: 2px 0 !important;
}

.iq-sidebar-menu .side-menu .submenu li a {
  border-radius: 10px !important;
  padding: 8px 12px !important;
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  background: transparent !important;
  transition: all 0.2s ease !important;
}

.iq-sidebar-menu .side-menu .submenu li a:hover,
.iq-sidebar-menu .side-menu .submenu li.active a {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fde047 !important;
  transform: translateX(4px) !important;
}

.iq-sidebar-menu .side-menu .submenu li a img {
  border-radius: 8px !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.iq-sidebar-menu .side-menu li > a .arrow-active,
.iq-sidebar-menu .side-menu li > a svg.iq-arrow-right {
  display: inline-block !important;
  opacity: 1 !important;
  transition: transform 0.3s ease !important;
  margin-left: auto;
}

.iq-sidebar-menu .side-menu li > a[aria-expanded="true"] .arrow-active,
.iq-sidebar-menu .side-menu li > a[aria-expanded="true"] svg.iq-arrow-right,
.iq-sidebar-menu .side-menu li.active > a .arrow-active {
  transform: rotate(90deg) !important;
}

/* ==========================================================================
   5. SELECT2 & DROPDOWN BUFF MXH (Hiển Thị Đầy Đủ Tên Dịch Vụ Trên Mobile)
   ========================================================================== */
.select2-container {
  width: 100% !important;
}

.select2-container--bootstrap4 .select2-selection--single,
.select2-container--default .select2-selection--single,
select.form-control {
  background: #f8fafc !important;
  border-radius: 12px !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: none !important;
  min-height: 48px !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  padding: 7px 34px 7px 12px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.dark .select2-container--bootstrap4 .select2-selection--single,
body.dark .select2-container--default .select2-selection--single,
body.dark select.form-control {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection--single,
.select2-container--bootstrap4.select2-container--open .select2-selection--single,
select.form-control:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

body.dark .select2-container--bootstrap4.select2-container--focus .select2-selection--single,
body.dark .select2-container--bootstrap4.select2-container--open .select2-selection--single {
  background: #0f172a !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
  line-height: 1.4 !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 100% !important;
  text-transform: none !important;
}

body.dark .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
  color: #f1f5f9 !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%) !important;
  transition: transform 0.25s ease !important;
}

.select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow {
  transform: translateY(-50%) rotate(180deg) !important;
}

/* Menu Xổ Xuống (Select2 Dropdown) */
.select2-dropdown,
.dropdown-menu {
  background: #ffffff !important;
  border-radius: 16px !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16) !important;
  overflow: hidden !important;
  padding: 8px !important;
  margin-top: 6px !important;
  z-index: 99999 !important;
}

body.dark .select2-dropdown,
body.dark .dropdown-menu {
  background: #1e293b !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65) !important;
}

/* Ô tìm kiếm bên trong Dropdown (Rõ viền & nền) */
.select2-search--dropdown {
  padding: 4px 4px 8px 4px !important;
}

.select2-search--dropdown .select2-search__field {
  background: #f1f5f9 !important;
  border-radius: 10px !important;
  border: 1.5px solid #cbd5e1 !important;
  padding: 9px 12px !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
}

.select2-search--dropdown .select2-search__field:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
  outline: none !important;
}

body.dark .select2-search--dropdown .select2-search__field {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  color: #f8fafc !important;
}

/* Các hàng lựa chọn trong danh sách */
.select2-results__options {
  max-height: 340px !important;
}

.select2-results__option {
  border-radius: 12px !important;
  margin: 4px 0 !important;
  padding: 9px 12px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  border: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
  transition: background-color 0.15s ease, border-color 0.15s ease !important;
  display: block !important;
}

body.dark .select2-results__option {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
  color: #e2e8f0 !important;
}

/* Hover / Highlight */
.select2-container--bootstrap4 .select2-results__option--highlighted:not([aria-selected="true"]),
.select2-results__option--highlighted:not([aria-selected="true"]),
.select2-results__option:hover:not([aria-selected="true"]) {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1e40af !important;
}

body.dark .select2-container--bootstrap4 .select2-results__option--highlighted:not([aria-selected="true"]),
body.dark .select2-results__option:hover:not([aria-selected="true"]) {
  background: rgba(37, 99, 235, 0.22) !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
  color: #f8fafc !important;
}

/* Hàng đang được chọn: Tương phản tuyệt đối trắng/vàng trên nền xanh iOS */
.select2-container--bootstrap4 .select2-results__option[aria-selected="true"],
.select2-results__option[aria-selected="true"] {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%) !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

.select2-results__option[aria-selected="true"] .smm-opt-name {
  color: #ffffff !important;
}

.select2-results__option[aria-selected="true"] .smm-opt-price {
  color: #fde047 !important;
}

.select2-results__option[aria-selected="true"] .smm-opt-unit {
  color: rgba(255, 255, 255, 0.9) !important;
}

.select2-results__option[aria-selected="true"] .smm-id-badge {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.select2-results__option[aria-selected="true"] .smm-opt-refill {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

/* ==========================================================================
   6. STAT CARDS & NÚT ĐẶT HÀNG
   ========================================================================== */
.smm-stat-card {
  background: #f8fafc !important;
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
  transition: transform 0.2s ease, border-color 0.2s ease !important;
}

body.dark .smm-stat-card {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

.smm-stat-icon-wrap {
  border-radius: 12px !important;
}

.smm-submit-btn.active {
  background: linear-gradient(135deg, #2563eb, #0ea5e9, #06b6d4) !important;
  background-size: 200% 200% !important;
  animation: iosAuraGlow 4s ease infinite !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
  border-radius: 14px !important;
  color: #ffffff !important;
}

/* ==========================================================================
   7. THANH CUỘN & TỐI ƯU MOBILE 60-120FPS
   ========================================================================== */
.select2-results__options::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
body::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}

.select2-results__options::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
  background: transparent !important;
}

.select2-results__options::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45) !important;
  border-radius: 10px !important;
}

html, body {
  -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 991px) {
  html, body {
    scroll-behavior: auto !important;
    touch-action: auto !important;
  }
}

* {
  -webkit-tap-highlight-color: transparent !important;
}
