/* ToFindAI Console Theme (image-based sci-fi chassis)
   Visual layer only — does not change layout JS/PHP.
*/

body.theme-console{
  background-color:#050608;
  background-image:url('/assets/img/console/bg-chassis-tile.png');
  background-repeat:repeat;
  background-attachment:fixed;
}

body.theme-console::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  /* vignette + subtle cool haze */
  background:
    radial-gradient(1200px 700px at 50% 10%, rgba(255,255,255,0.06), rgba(0,0,0,0.00) 60%),
    radial-gradient(900px 600px at 15% 55%, rgba(212,175,55,0.05), rgba(0,0,0,0.00) 65%),
    radial-gradient(900px 600px at 85% 55%, rgba(255,45,45,0.05), rgba(0,0,0,0.00) 65%),
    linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.70));
  z-index:-1;
}

/* Reduce “rounded friendly UI” */
body.theme-console .hero,
body.theme-console .card,
body.theme-console .category-card,
body.theme-console .listing-card,
body.theme-console .form-section,
body.theme-console .admin-top{
  border-radius:10px !important;
}

/* ===== HERO: frame overlay (9-slice) ===== */
body.theme-console .hero{
  background: rgba(10,12,16,0.55);
  position:relative;
  overflow:hidden;
  /* ensure content stays away from frame */
  padding: clamp(2.8rem, 5vw, 4.6rem) clamp(1.4rem, 4vw, 5.2rem);
}

body.theme-console .hero::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border: 72px solid transparent;
  border-image-source: url('/assets/img/console/frame-hero-9slice_transparent-center.png');
  border-image-slice: 160 fill;
  border-image-width: 72;
  border-image-repeat: stretch;
  filter: drop-shadow(0 18px 70px rgba(0,0,0,0.65));
  z-index:0;
}

/* Keep hero text above overlay */
body.theme-console .hero > *{ position:relative; z-index:1; }

/* ===== PANELS / CARDS: frame overlay (9-slice) ===== */
body.theme-console .category-card,
body.theme-console .card,
body.theme-console .form-section,
body.theme-console .listing-card,
body.theme-console .admin-top{
  background: rgba(10,12,16,0.66) !important;
  border: none !important;
  box-shadow: 0 20px 70px rgba(0,0,0,0.55) !important;
  position:relative;
  overflow:hidden;
}

/* remove existing glossy overlays */
body.theme-console .category-card::before,
body.theme-console .card::before,
body.theme-console .form-section::before,
body.theme-console .listing-card::before{
  background:none !important;
}

body.theme-console .card::after,
body.theme-console .form-section::after,
body.theme-console .listing-card::after,
body.theme-console .admin-top::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border: 58px solid transparent;
  border-image-source: url('/assets/img/console/frame-card-9slice_transparent-center.png');
  border-image-slice: 140 fill;
  border-image-width: 58;
  border-image-repeat: stretch;
  z-index:0;
  filter: drop-shadow(0 14px 40px rgba(0,0,0,0.55));
}

/* ===== CATEGORY CARDS: lighter “thin corner” hardware (avoid busy frame behind text) ===== */
body.theme-console .category-card{
  /* keep cards readable; let the title/description sit on a calm core */
  background:
    linear-gradient(180deg, rgba(0,0,0,0.28), rgba(0,0,0,0.55)),
    url('/assets/img/console/tile-perf.png');
  background-size: auto, 360px 360px;
  background-repeat: no-repeat, repeat;
  padding: 2.2rem 1.6rem !important;
}

/* thin corner overlays (no stretching of the art — we stamp them at a fixed size) */
body.theme-console .category-card::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:0;
  background-image:
    url('/assets/img/console/corners/top_left_thin1.png'),
    url('/assets/img/console/corners/top_right_thin1.png'),
    url('/assets/img/console/corners/bottom_left_thin1.png'),
    url('/assets/img/console/corners/bottom_right_thin1.png');
  background-repeat: no-repeat;
  background-position: left top, right top, left bottom, right bottom;
  /* fixed “stamp” size keeps edges crisp on any screen */
  background-size: 120px 120px;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.55));
  opacity: 0.98;
}

/* Give content breathing room so it doesn’t sit under the corners */
body.theme-console .category-card > *{ position:relative; z-index:1; }

body.theme-console .card,
body.theme-console .form-section,
body.theme-console .listing-card{ padding: 2.6rem 2rem !important; }

/* ensure inner content is above frame overlay */
body.theme-console .category-card > *,
body.theme-console .card > *,
body.theme-console .form-section > *,
body.theme-console .listing-card > *,
body.theme-console .admin-top > *{ position:relative; z-index:1; }

/* ===== Perforated texture zones (subtle) ===== */
body.theme-console .sidebar,
body.theme-console .category-hero,
body.theme-console .pricing-card{
  background-image:
    linear-gradient(180deg, rgba(0,0,0,0.20), rgba(0,0,0,0.45)),
    url('/assets/img/console/tile-perf.png');
  background-size: auto, 360px 360px;
  background-repeat: repeat, repeat;
}

/* ===== Header: add thin rails, keep readable ===== */
body.theme-console header{
  background: rgba(8,10,14,0.80) !important;
  backdrop-filter: blur(8px);
}
body.theme-console header::after{
  content:"";
  position:absolute;
  left:0;right:0;bottom:0;
  height:3px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.00), rgba(255,45,45,0.70), rgba(212,175,55,0.55), rgba(0,0,0,0.00));
  pointer-events:none;
}

/* ===== Buttons: avoid red-on-red; gunmetal defaults ===== */
body.theme-console .btn-secondary,
body.theme-console button,
body.theme-console .search-box button{
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)) !important;
  border: 1px solid rgba(212,175,55,0.28) !important;
  color: rgba(245,247,250,0.95) !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.55);
}

body.theme-console .btn-primary{
  background: linear-gradient(180deg, #ff3d3d, #b31414) !important;
  border: 1px solid rgba(255,45,45,0.55) !important;
  box-shadow: 0 16px 44px rgba(255,45,45,0.28);
}

/* chips/toggles (sponsor placements etc.) */
body.theme-console .pill,
body.theme-console .chip,
body.theme-console .toggle,
body.theme-console .sidebar-link,
body.theme-console .plan-card{
  background: rgba(0,0,0,0.35) !important;
  border: 1px solid rgba(199,208,219,0.18) !important;
  color: rgba(245,247,250,0.92) !important;
}

/* Active sidebar links: strong contrast */
body.theme-console .sidebar-link.active{
  background: rgba(255,45,45,0.18) !important;
  border-color: rgba(255,45,45,0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,45,45,0.12);
}
body.theme-console .sidebar-link,
body.theme-console .sidebar-link *{ position:relative; z-index:1; }

/* Mobile: reduce frame thickness so it doesn’t eat content */
@media (max-width: 680px){
  body.theme-console .hero{ padding: 2.6rem 1.2rem; }
  body.theme-console .hero::before{ border-width: 44px; border-image-width: 44; }

  body.theme-console .card::after,
  body.theme-console .form-section::after,
  body.theme-console .listing-card::after{ border-width: 40px; border-image-width: 40; }

  body.theme-console .category-card{ padding: 1.8rem 1.1rem !important; }
  body.theme-console .category-card::after{ background-size: 92px 92px; }
  body.theme-console .card,
  body.theme-console .form-section,
  body.theme-console .listing-card{ padding: 2.0rem 1.3rem !important; }
}
