/* HyperBox — ChatGPT Black Theme */
:root{
  --bg:#000000;
  --panel:#0d0d0d;
  --muted:#8a8a8a;
  --accent:#5f5bff;     /* ChatGPT purple */
  --accent-2:#7d78ff;
  --glass: rgba(255,255,255,0.05);
  --radius:20px;
  --shadow: 0 8px 30px rgba(0,0,0,0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
  color-scheme: dark;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:#000;
  color:#fff;
  -webkit-font-smoothing:antialiased;
  font-size:15px;
}

/* Layout ------------------------------------------------------*/
.hb-app{
  display:flex;
  min-height:100vh;
  background:#000;
}

.hb-sidebar{
  width:260px;
  padding:22px;
  background:#0d0d0d;
  border-right:1px solid #1a1a1a;
  display:flex;
  flex-direction:column;
  gap:16px;
  box-shadow:var(--shadow);
}

.hb-brand{margin-bottom:6px}
.hb-logo{
  font-weight:800;
  font-size:22px;
  color:var(--accent);
  letter-spacing:0.6px;
}
.hb-tag{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

.hb-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
}
.hb-link{
  display:block;
  padding:12px 14px;
  border-radius:14px;
  color:var(--muted);
  text-decoration:none;
  transition:0.2s;
}
.hb-link:hover{
  background:#111;
  color:#fff;
}
.hb-link.active{
  background:#111;
  color:var(--accent);
  border-left:3px solid var(--accent);
}

.hb-footer{
  margin-top:auto;
  color:var(--muted);
  font-size:13px;
  text-align:center;
  padding-top:10px;
}

/* Main ------------------------------------------------------*/
.hb-main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  background:#000;
}

.hb-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 22px;
  border-bottom:1px solid #111;
}

.hb-toggle{
  background:#111;
  border:1px solid #1a1a1a;
  padding:10px 12px;
  border-radius:16px;
  color:var(--muted);
  cursor:pointer;
}

.hb-header-right{
  display:flex;
  gap:12px;
  align-items:center;
}

/* Content ------------------------------------------------------*/
.hb-content{padding:26px}
.container{
  max-width:1100px;
  margin:0 auto;
}

.hb-title{
  font-size:26px;
  margin:0;
}
.hb-lead{
  color:var(--muted);
  margin-top:6px;
}

/* Cards Grid ---------------------------------------------------*/
.cards-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:18px;
  margin-top:18px;
}
.card{
  background:#111;
  padding:18px;
  border-radius:18px;
  border:1px solid #1a1a1a;
  text-decoration:none;
  color:#fff;
  display:block;
  box-shadow:0 8px 20px rgba(0,0,0,0.4);
  transition:0.18s;
}
.card:hover{
  transform:translateY(-4px);
}
.card-icon{
  font-size:28px;
  margin-bottom:8px;
  color:var(--accent);
}

/* Sections */
.news{
  margin-top:22px;
  background:transparent;
  padding:16px;
  border-radius:16px;
  color:var(--muted);
}

/* Encoder Layout -----------------------------------------------*/
.enc-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin-top:14px;
}
.enc-panel{
  background:#111;
  padding:14px;
  border-radius:18px;
  border:1px solid #1a1a1a;
}
.controls{
  display:flex;
  gap:8px;
  margin-top:12px;
}

.btn{
  background:var(--accent);
  border:none;
  padding:12px 18px;
  border-radius:18px;
  color:#000;
  font-weight:700;
  cursor:pointer;
  transition:0.2s;
}
.btn:hover{
  opacity:0.85;
}

.btn.ghost{
  background:#111;
  border:1px solid #1a1a1a;
  color:var(--muted);
  font-weight:600;
}

/* Helpers ------------------------------------------------------*/
.mode{color:var(--muted);margin-top:12px}
.hint{margin-top:10px;color:var(--muted);font-size:13px}

kbd{
  background:#111;
  padding:2px 6px;
  border-radius:6px;
  border:1px solid #1a1a1a;
  font-weight:600;
}

/* Games -------------------------------------------------------*/
.game-area{margin-top:18px}
.game-card{
  background:#111;
  padding:16px;
  border-radius:18px;
  border:1px solid #1a1a1a;
}

/* Memory Game */
.memory-board{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin-top:12px;
}
.mem-card{
  height:80px;
  border-radius:16px;
  border:1px solid #1a1a1a;
  background:#0c0c0c;
  color:#fff;
  font-size:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  cursor:pointer;
}
.mem-card .icon{
  position:absolute;
  opacity:0;
  transition:opacity .2s;
}
.mem-card.open .icon{opacity:1}
.mem-card.open .face{opacity:0}

/* Tools Grid */
.tools-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:16px;
}
.tool-card{
  background:#111;
  padding:14px;
  border-radius:18px;
  border:1px solid #1a1a1a;
}

/* Responsive Sidebar ------------------------------------------*/
@media(max-width:900px){
  .hb-sidebar{
    position:fixed;
    left:-320px;
    top:0;
    height:100%;
    transition:left .25s ease;
    z-index:1000;
  }
  .hb-sidebar.open{left:0}
  .hb-app{padding-left:0}
  .hb-main{margin-left:0}
  .hb-header{padding:12px}
  }

/* -----------------------------------------------------------
   CHATGPT-STYLE ANIMATION + FLOATING NAV + MODALS UPGRADE PACK
------------------------------------------------------------*/

/* Smooth fade & slide for UI elements */
.fade-in {
  animation: fadeIn .35s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card hover animation */
.card:hover,
.tool-card:hover,
.game-card:hover,
.enc-panel:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}

/* Pulsing purple accent glow */
.glow-accent {
  box-shadow: 0 0 14px var(--accent);
}

.glow-accent-soft {
  box-shadow: 0 0 30px rgba(95, 91, 255, 0.3);
}

/* Button tap animation */
.btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* Sidebar slide animation */
.hb-sidebar {
  transition: left 0.3s cubic-bezier(.25,.8,.25,1);
}

/* ============================================================
   FLOATING BOTTOM NAV (mobile-first, ChatGPT style)
============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  border: 1px solid #1a1a1a;
  padding: 12px 20px;
  border-radius: 40px;
  display: flex;
  gap: 22px;
  align-items: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  z-index: 999;
}

.bottom-nav button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition: 0.25s;
}

.bottom-nav button:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

/* ============================================================
   GLASSY CHATGPT MODALS — dark, clean, center floating
============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal {
  background: #111;
  border: 1px solid #1a1a1a;
  padding: 26px;
  width: 90%;
  max-width: 420px;
  border-radius: 22px;
  animation: modalPop .3s ease;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h2 {
  margin-top: 0;
  font-size: 22px;
}

.modal p {
  color: var(--muted);
  margin: 10px 0 16px;
}

.modal button {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
}

.modal-close {
  background: #111;
  border: 1px solid #1a1a1a;
  color: var(--muted);
}

.modal-confirm {
  background: var(--accent);
  border: none;
  color: #000;
  font-weight: 700;
}

/* ============================================================
   HIGH CONTRAST MODE (toggle class on <body>)
============================================================ */
body.high-contrast {
  --bg:#000;
  --panel:#0d0d0d;
  --accent:#ffffff;
  --accent-2:#ffffff;
  --muted:#cccccc;
}

body.high-contrast .card,
body.high-contrast .tool-card,
body.high-contrast .game-card,
body.high-contrast .enc-panel {
  border-color:#fff;
}

/* ============================================================
   MOBILE POLISH — smoother resizing, nicer spacing
============================================================ */
@media(max-width:600px){
  .hb-content{padding:20px}
  .hb-title{font-size:24px}
  .card, .tool-card, .game-card, .enc-panel {
    border-radius: 16px;
  }
}
