
/* === STABLE VERSION (no filters, reliable bg, click-safe modals) === */

/* Global background: image + slight darkening via gradient (no filters!) */
html, body {
  background-color: #0b0f1a !important;
  background-image:
    linear-gradient(rgba(0,0,0,0.14), rgba(0,0,0,0.14)),
    url('../img/bg-site-fon.jpg'),
    url('../assets/img/bg-site-fon.jpg') !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  background-size: cover !important;
}

/* Keep layout wrappers transparent */
.wapper, .content, .container, .row, .navigation,
.breadcrumbs, .b-breadcrumbs, .b-page__header, .b-page__content,
.wapper .header, .wapper > .footer {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Blocks: readable glass with soft glow */
.block, .card, .panel, .table-responsive, .widget, .sidebar .block {
  background: rgba(12, 14, 28, 0.82) !important;
  border: 1px solid rgba(120, 80, 255, 0.45) !important;
  border-radius: 14px !important;
  box-shadow:
    0 0 10px rgba(120, 80, 255, 0.28),
    0 0 20px rgba(80, 160, 255, 0.14) !important;
}

.block .block_head, .table thead th, .table th {
  background: rgba(20, 22, 40, 0.9) !important;
  color: #e6e6ff !important;
  border-color: rgba(120, 80, 255, 0.35) !important;
}

/* Forms */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="search"], select, textarea,
.form-control {
  background: rgba(16, 18, 34, 0.96) !important;
  color: #e8e7ff !important;
  border: 1px solid rgba(120, 80, 255, 0.5) !important;
  box-shadow: inset 0 0 4px rgba(80,160,255,0.15) !important;
}
.form-control::placeholder { color: rgba(210, 210, 255, 0.6) !important; }
.form-control:focus {
  outline: none !important;
  border-color: rgba(150, 110, 255, 0.9) !important;
  box-shadow: 0 0 8px rgba(150,110,255,0.4) !important;
}

/* Buttons */
.btn, .btn-primary, .btn-outline-primary {
  background: rgba(20, 20, 40, 0.85) !important;
  color: #e8e7ff !important;
  border: 1px solid rgba(120, 80, 255, 0.8) !important;
  box-shadow: 0 0 10px rgba(120,80,255,0.35), 0 0 18px rgba(80,160,255,0.2) !important;
}
.btn:hover, .btn-primary:hover, .btn-outline-primary:hover {
  background: rgba(80, 40, 180, 0.9) !important;
  color: #fff !important;
}

/* CLICK SAFETY: modal & backdrop layering */
.modal-backdrop {
  z-index: 1060 !important;
  background-color: rgba(0,0,0,0.6) !important;
}
.modal {
  z-index: 1070 !important;
}
.modal-dialog, .modal-content, .modal-header, .modal-body, .modal-footer, .modal * {
  pointer-events: auto !important;
}

/* Close buttons always clickable */
.modal .close, .modal [data-dismiss="modal"], .modal button.close {
  position: relative !important;
  z-index: 1080 !important;
  pointer-events: auto !important;
}

/* Chat: drag-drop mask must not block clicks */
#drop_mask { 
  pointer-events: none !important;
  z-index: 1 !important;
}
#drop_zone, #chat, #chatrules { pointer-events: auto !important; }

/* Popovers & tooltips */
.popover, .tooltip { z-index: 1065 !important; }

/* Remove any pseudo overlays that could intercept clicks */
.block::before, .block::after,
.card::before, .card::after,
.table-responsive::before, .table-responsive::after {
  content: none !important;
  display: none !important;
  pointer-events: none !important;
}


/* === CLICK FIX LAYER ORDER (2025-09-14) === */
/* Any full-screen decorative layers must not intercept clicks */
html::before, html::after, body::before, body::after {
  pointer-events: none !important;
}

[class*="bg"], [class*="overlay"], [class*="backdrop"], [class*="glow"], [class*="shade"], [class*="shadow"] {
  /* only apply to big layers; interactive components will override below */
  -webkit-pointer-events: none !important;
  pointer-events: none !important;
}

/* Ensure modals and popups are above any effects */
.modal, [role="dialog"] { z-index: 1055 !important; pointer-events: auto !important; }
.modal-backdrop { z-index: 1050 !important; }
.dropdown-menu, .popover, .tooltip { z-index: 1060 !important; pointer-events: auto !important; }

/* Responsive table areas inside modals must accept clicks/scroll */
.table-responsive, .table-responsive * { pointer-events: auto !important; }

/* Safety: known full-screen classes often used in this theme */
.page-bg, .page-glow, .screen-glow, .screen-shade, .bg-image, .theme-ghost-bg, .theme_ghost_bg, .theme_ghost_bg_1, .theme_ghost_bg_2 {
  position: fixed;
  inset: 0;
  z-index: 0 !important;
  pointer-events: none !important;
}

/* If someone used ::before/::after overlays on blocks, disable clicks there too */
.block::before, .block::after,
.card::before, .card::after,
.table-responsive::before, .table-responsive::after {
  pointer-events: none !important;
}
