/* MaxPlay Digital - 2026 UI refresh layer */
:root {
  --mp-bg: #080b10;
  --mp-surface: #0f141d;
  --mp-surface-2: #151c27;
  --mp-border: rgba(177, 193, 214, 0.14);
  --mp-border-strong: rgba(177, 193, 214, 0.24);
  --mp-text: #f4f7fb;
  --mp-muted: #96a3b4;
  --mp-dim: #687487;
  --mp-red: #e23b3b;
  --mp-cyan: #38c7d9;
  --mp-lime: #8bd450;
  --mp-gold: #f0b84b;
  --mp-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --bg-primary: var(--mp-bg);
  --bg-secondary: var(--mp-surface);
  --bg-card: var(--mp-surface-2);
  --border: var(--mp-border);
  --text: var(--mp-text);
  --text-muted: var(--mp-muted);
  --text-dim: var(--mp-dim);
  --accent: var(--mp-red);
  --accent-light: #ff6969;
}

* { letter-spacing: 0 !important; }
html { color-scheme: dark; }
html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--mp-bg) !important;
  color: var(--mp-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body, input, button, textarea, select {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

a { color: inherit; }
img { max-width: 100%; }

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: mpViewOut 0.16s ease both;
}

::view-transition-new(root) {
  animation: mpViewIn 0.22s ease 0.02s both;
}

@keyframes mpViewOut {
  to { opacity: 0; transform: translateY(4px) scale(0.996); filter: blur(2px); }
}

@keyframes mpViewIn {
  from { opacity: 0; transform: translateY(8px) scale(0.998); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

#scrollProgress {
  height: 2px !important;
  background: linear-gradient(90deg, var(--mp-red), var(--mp-cyan), var(--mp-lime)) !important;
  box-shadow: 0 0 18px rgba(56, 199, 217, 0.34);
  transition: width 0.24s ease, opacity 0.18s ease !important;
}

html.mp-pjax-loading #scrollProgress,
html.mp-hard-navigating #scrollProgress {
  opacity: 1;
}

html.mp-hard-navigating body {
  cursor: progress;
}

html.mp-hard-navigating body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  background: rgba(8, 11, 16, 0.18);
  backdrop-filter: blur(2px);
  animation: mpHardNavVeil 0.16s ease both;
}

@keyframes mpHardNavVeil {
  from { opacity: 0; }
  to { opacity: 1; }
}

#mp-page {
  view-transition-name: mp-page;
  will-change: opacity, transform, filter;
}

#mp-page.mp-page-leave {
  animation: mpPageLeave 0.16s ease both;
}

#mp-page.mp-page-enter,
.page-wrapper,
.auth-page,
.admin-page-wrap,
.prod-wrap {
  animation: mpPageEnter 0.24s ease both;
}

@keyframes mpPageLeave {
  to { opacity: 0; transform: translateY(5px); filter: blur(2px); }
}

@keyframes mpPageEnter {
  from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.v6-card,
.hist-card,
.login-card,
.prod-image-card,
.prod-info,
.prod-panel,
.admin-stat,
.admin-quick-card,
.admin-table-wrap,
.card {
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease !important;
}

.v6-grid .v6-card:nth-child(1),
.login-card:nth-child(1),
.hist-card:nth-child(1) { animation-delay: 0.02s; }
.v6-grid .v6-card:nth-child(2),
.login-card:nth-child(2),
.hist-card:nth-child(2) { animation-delay: 0.04s; }
.v6-grid .v6-card:nth-child(3),
.login-card:nth-child(3),
.hist-card:nth-child(3) { animation-delay: 0.06s; }
.v6-grid .v6-card:nth-child(4),
.login-card:nth-child(4),
.hist-card:nth-child(4) { animation-delay: 0.08s; }

.v6-card,
.login-card,
.hist-card,
.prod-image-card,
.prod-info,
.prod-panel {
  animation: mpItemIn 0.28s ease both;
}

@keyframes mpItemIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.v6-topbar,
.navbar {
  background: rgba(8, 11, 16, 0.94) !important;
  border-bottom: 1px solid var(--mp-border) !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.v6-logo,
.navbar-logo {
  color: var(--mp-text) !important;
  font-weight: 850 !important;
}

.v6-logo span,
.navbar-logo span { color: var(--mp-red) !important; }

.v6-search,
.table-search-input,
.form-control,
input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  background: #0d121a !important;
  border: 1px solid var(--mp-border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--mp-text) !important;
  box-shadow: none !important;
}

.v6-search:focus,
.table-search-input:focus,
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(56, 199, 217, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(56, 199, 217, 0.14) !important;
  outline: none !important;
}

.v6-layout {
  max-width: 1520px !important;
  padding: 26px clamp(14px, 2.6vw, 36px) !important;
  gap: 26px !important;
}

.v6-sidebar {
  background: rgba(15, 20, 29, 0.72);
  border: 1px solid var(--mp-border);
  border-radius: var(--radius-md);
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 86px;
}

.v6-sidebar-item {
  border-radius: var(--radius-sm) !important;
  min-height: 38px;
}

.v6-sidebar-item.active,
.v6-sidebar-item:hover {
  background: rgba(56, 199, 217, 0.1) !important;
  color: var(--mp-text) !important;
}

.v6-tagline h1 {
  font-size: clamp(1.7rem, 3.4vw, 3rem) !important;
  max-width: 880px;
}

.v6-tagline h1 span { color: var(--mp-cyan) !important; }
.v6-tagline p { color: var(--mp-muted) !important; max-width: 680px !important; }

.v6-carousel,
.v6-spotlight,
.v6-card,
.card,
.auth-card,
.modal,
.cart-sidebar,
.cart-success-card,
.payment-card,
.admin-stat,
.admin-quick-card,
.admin-table-wrap,
.theme-switcher {
  background: var(--mp-surface) !important;
  border: 1px solid var(--mp-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
}

.v6-card {
  min-height: 100%;
  overflow: hidden;
}

.v6-card:hover,
.v6-spotlight:hover,
.admin-quick-card:hover,
.admin-stat:hover,
.card:hover {
  border-color: var(--mp-border-strong) !important;
  transform: translateY(-2px);
  box-shadow: var(--mp-shadow) !important;
}

.v6-card-img,
.v6-carousel-img,
.v6-spotlight-img img {
  object-fit: cover !important;
}

.v6-card-body { padding: 14px !important; gap: 8px !important; }
.v6-card-title { color: var(--mp-text) !important; white-space: normal !important; min-height: 2.35em; }
.v6-card-price { color: var(--mp-text) !important; }
.v6-card-price.free,
.text-lime { color: var(--mp-lime) !important; }

.v6-card-info-badge,
.badge,
.v6-badge-seal,
.v6-feat,
.cat-count {
  border-radius: var(--radius-sm) !important;
  background: rgba(150, 163, 180, 0.08) !important;
  border: 1px solid var(--mp-border) !important;
  color: var(--mp-muted) !important;
}

.v6-card-disc,
.v6-carousel-dot.active {
  background: var(--mp-red) !important;
}

.btn,
.v6-btn,
.v6-card-btn,
.v6-spotlight-btn,
.v6-carousel-btn,
.cart-checkout-btn,
button[type="submit"] {
  border-radius: var(--radius-md) !important;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease !important;
}

.btn-primary,
.v6-btn.blue,
.v6-card-btn,
.v6-carousel-btn,
.cart-checkout-btn {
  background: var(--mp-red) !important;
  border-color: var(--mp-red) !important;
  color: #fff !important;
}

.btn-lime {
  background: var(--mp-lime) !important;
  border-color: var(--mp-lime) !important;
  color: #08100a !important;
}

.btn-outline,
.btn-ghost,
.v6-btn {
  background: rgba(150, 163, 180, 0.06) !important;
  border: 1px solid var(--mp-border) !important;
  color: var(--mp-text) !important;
}

.btn:hover,
.v6-btn:hover,
.v6-card-btn:hover,
.cart-checkout-btn:hover {
  transform: translateY(-1px);
}

.v6-cat-line {
  background: linear-gradient(90deg, rgba(56, 199, 217, 0.55), rgba(139, 212, 80, 0.12)) !important;
}

.v6-cat-title,
.section-title,
.admin-topbar h1 {
  color: var(--mp-text) !important;
}

.v6-footer {
  background: #090d13 !important;
  border-top: 1px solid var(--mp-border) !important;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 430px);
  padding: 28px !important;
}

#particles { opacity: 0.18; }

.admin-page-wrap {
  background: var(--mp-bg) !important;
}

.admin-main {
  background: var(--mp-bg) !important;
}

.admin-sidenav {
  background: #0b1017 !important;
  border-right: 1px solid var(--mp-border) !important;
}

.admin-sidenav-item {
  border-radius: var(--radius-sm) !important;
}

.admin-sidenav-item.active,
.admin-sidenav-item:hover {
  background: rgba(56, 199, 217, 0.09) !important;
  color: var(--mp-text) !important;
  border-left-color: var(--mp-cyan) !important;
}

.admin-stats-grid,
.admin-quick-actions {
  gap: 12px !important;
}

.admin-stat::before {
  background: var(--mp-cyan) !important;
}

.admin-stat.g::before { background: var(--mp-lime) !important; }
.admin-stat.y::before { background: var(--mp-gold) !important; }

.table th {
  background: #111924 !important;
  color: var(--mp-muted) !important;
}

.table td {
  border-bottom-color: rgba(177, 193, 214, 0.08) !important;
}

.table tbody tr:hover {
  background: rgba(56, 199, 217, 0.05) !important;
}

.modal-overlay {
  background: rgba(2, 4, 8, 0.72) !important;
  backdrop-filter: blur(8px);
}

.alert {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--mp-border) !important;
}

.alert-success { background: rgba(139, 212, 80, 0.1) !important; color: #cdf0b5 !important; }
.alert-error { background: rgba(226, 59, 59, 0.12) !important; color: #ffc5c5 !important; }
.alert-info { background: rgba(56, 199, 217, 0.1) !important; color: #c2f6ff !important; }

.cart-overlay.open {
  background: rgba(2, 4, 8, 0.62) !important;
}

.cart-sidebar {
  border-radius: 0 !important;
  border-left: 1px solid var(--mp-border) !important;
}

.cart-item,
.cart-success-item,
.login-result-box {
  background: #0d121a !important;
  border: 1px solid rgba(177, 193, 214, 0.11) !important;
  border-radius: var(--radius-md) !important;
}

.table,
.admin-table-wrap,
.table-responsive {
  max-width: 100%;
}

.table-responsive,
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
  white-space: nowrap;
}

.pix-copy-field,
.login-content,
.cart-success-login,
pre {
  overflow-wrap: anywhere;
  word-break: break-word;
}

input,
textarea,
select,
button,
a {
  touch-action: manipulation;
}

@media (max-width: 900px) {
  body.has-v6-bottom-nav {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.has-v6-bottom-nav .v6-footer,
  body.has-v6-bottom-nav footer {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .container,
  .page-wrapper,
  .auth-page,
  .prod-wrap,
  .admin-main {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: max(12px, env(safe-area-inset-left, 12px)) !important;
    padding-right: max(12px, env(safe-area-inset-right, 12px)) !important;
  }

  .page-wrapper {
    padding-top: 14px !important;
  }

  .v6-topbar {
    top: 0;
    min-height: 54px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.26);
  }

  .v6-search {
    min-height: 38px;
    font-size: 16px !important;
  }

  .ac-dropdown {
    position: fixed !important;
    top: 58px !important;
    left: 10px !important;
    right: 10px !important;
    max-height: min(58vh, 420px) !important;
    border-radius: 12px !important;
    z-index: 9500 !important;
  }

  .v6-layout { padding: 12px 10px !important; }
  .v6-sidebar {
    position: static;
    padding: 10px;
    margin-bottom: 10px;
  }
  .v6-sidebar-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px !important;
  }
  .v6-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .v6-card-body { padding: 10px !important; }
  .v6-card-title { font-size: 0.78rem !important; }
  .v6-card-price { font-size: 1rem !important; }
  .admin-main { padding: 16px !important; }

  .btn,
  .v6-btn,
  .v6-card-btn,
  .prod-action-btn,
  .cart-checkout-btn,
  button[type="submit"],
  input[type="submit"] {
    min-height: 44px;
  }

  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  .auth-page {
    min-height: calc(100dvh - 56px);
    align-items: start;
    padding-top: 18px !important;
  }

  .auth-card,
  .payment-card,
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 12px !important;
  }

  .payment-card {
    padding: 18px 14px !important;
  }

  .qr-container img,
  .qr-container > div {
    width: min(68vw, 220px) !important;
    height: min(68vw, 220px) !important;
  }

  .prod-wrap {
    padding-top: 12px !important;
  }

  .prod-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .prod-back {
    min-height: 42px;
    width: 100%;
    justify-content: center;
    margin-bottom: 12px !important;
  }

  .prod-image-card,
  .prod-info,
  .prod-panel {
    border-radius: 12px !important;
  }

  .prod-image-card img,
  .prod-image-card .prod-img-placeholder {
    aspect-ratio: 4 / 3 !important;
  }

  .prod-title {
    font-size: clamp(1.05rem, 5vw, 1.3rem) !important;
  }

  .prod-panel {
    position: static !important;
  }

  .var-option {
    min-height: 54px;
    padding: 10px 12px !important;
  }

  .var-option-name {
    white-space: normal !important;
  }

  .prod-actions {
    display: grid;
    gap: 10px;
  }

  .hist-toolbar,
  .logins-toolbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .hist-search,
  .logins-search {
    width: 100% !important;
    max-width: 100% !important;
  }

  .filter-group {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .filter-group::-webkit-scrollbar {
    display: none;
  }

  .filter-btn,
  .pagination a,
  .pagination span {
    min-height: 40px;
    align-items: center;
    justify-content: center;
  }

  .login-card,
  .hist-card {
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .login-card-header,
  .hist-card-header {
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .login-card-amount,
  .hist-card-amount {
    white-space: nowrap;
  }

  .admin-page-wrap {
    min-height: auto !important;
  }

  .admin-sidenav,
  .admin-sidebar {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--mp-border) !important;
  }

  .admin-stats-grid,
  .admin-quick-actions {
    grid-template-columns: 1fr !important;
  }

  .admin-table-wrap {
    border-radius: 12px !important;
  }

  .sup-layout,
  .admin-page-wrap:has(.adm-chat) {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100dvh - 56px) !important;
    min-height: calc(100dvh - 56px) !important;
    overflow: hidden !important;
  }

  .sup-chat,
  .adm-chat {
    min-height: 0 !important;
  }

  .sup-messages,
  .adm-messages {
    padding-bottom: 12px !important;
  }

  .sup-input-area,
  .adm-input-area {
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
  }

  .v6-float-support {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .toast-container {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 480px) {
  .v6-grid { gap: 8px !important; }
  .v6-carousel { border-radius: var(--radius-md) !important; }
  .auth-card { padding: 22px !important; }
  .v6-layout { padding-left: 8px !important; padding-right: 8px !important; }
  .v6-sidebar-list { grid-template-columns: 1fr 1fr !important; }
  .v6-sidebar-item { min-height: 38px; font-size: 0.72rem !important; }
  .v6-card-img { aspect-ratio: 1.25 / 1 !important; }
  .v6-card-title { min-height: 2.5em !important; }
  .v6-footer-grid { grid-template-columns: 1fr !important; }
  .modal-overlay { padding: 10px !important; }
  .cart-sidebar { width: 100vw !important; }
  .cart-success-card { width: calc(100vw - 18px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  #mp-page,
  .page-wrapper,
  .auth-page,
  .admin-page-wrap,
  .prod-wrap {
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }
}
