/* ===========================
   SecondSpark: Retro XP-ish Skin (Black + Pink)
   (Functionality unchanged)
   =========================== */

:root{
  /* Background */
  --bg:  #0a0a0f;          /* deep black */
  --bg2: #050507;

  /* Panels / cards */
  --panel:  #1b1b22;       /* dark gray */
  --panel2: #23232d;
  --card:   #101017;

  /* Text */
  --text:  #ffe9f4;        /* soft pink-white */
  --muted: rgba(255,233,244,.75);

  /* Borders */
  --border: rgba(255, 76, 166, .22);
  --borderDark: rgba(255, 76, 166, .40);

  /* Accents */
  --accent:  #ff4ca6;      /* main pink */
  --accent2: #ff86c8;      /* lighter pink */
  --danger:  #ff3b3b;
  --ok:      #ff4ca6;

  /* Shape */
  --shadow: 0 14px 40px rgba(0,0,0,.70);
  --radius: 10px;
  --radius2: 12px;
  --maxw: 1100px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: Tahoma, Verdana, "MS Sans Serif", Arial, sans-serif;
  color:var(--text);

  /* Retro "wallpaper" but dark */
  background:
    radial-gradient(900px 500px at 25% 20%, rgba(255,76,166,.12), transparent 65%),
    radial-gradient(900px 500px at 80% 10%, rgba(255,134,200,.08), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(255,76,166,.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

/* Links: subtle, retro */
a{color:inherit; text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:var(--maxw); margin:0 auto; padding:18px}

/* ======= Top bar: "title bar" vibe ======= */
.nav{
  position:sticky; top:0;
  background: linear-gradient(180deg, #1a0c16, #0b050a);
  border-bottom: 2px solid rgba(255,76,166,.35);
  z-index:50;
}
.nav-inner{
  max-width:var(--maxw);
  margin:0 auto;
  padding:10px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:700;
  letter-spacing:0;
  color:var(--text);
  text-shadow: 0 1px 0 rgba(0,0,0,.55);
}
.logo{
  width:26px; height:26px; border-radius:6px;
  background: linear-gradient(180deg, #ffe9f4, #ff86c8);
  border:1px solid rgba(0,0,0,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.nav-actions{display:flex; gap:8px; align-items:center}

/* ======= Panels: retro dialog boxes ======= */
.panel{
  border:1px solid var(--borderDark);
  background: linear-gradient(180deg, rgba(35,35,45,.96), rgba(27,27,34,.96));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel .p{padding:14px}

.h1{font-size:30px; margin:0 0 8px 0}
.h2{font-size:20px; margin:0 0 10px 0}
.muted{color:var(--muted)}

.sep{
  height:1px;
  background: rgba(255,76,166,.18);
  margin:12px 0;
}

/* ======= Inputs: dark XP textbox feel ======= */
.field{display:flex; flex-direction:column; gap:6px; margin:12px 0}
label{font-size:12px; color:var(--muted)}

input,select,textarea{
  background: rgba(12,12,18,.92);
  border:1px solid rgba(255,76,166,.30);
  color:var(--text);
  padding:10px 10px;
  border-radius: 6px;
  outline:none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.45);
}

textarea{min-height:110px; resize:vertical}

input:focus,select:focus,textarea:focus{
  border-color: rgba(255,76,166,.85);
  box-shadow: 0 0 0 2px rgba(255,76,166,.22);
}

.helper{font-size:12px; color:var(--muted)}

/* ======= Buttons: glossy retro, but black/pink ======= */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:9px 12px;
  border-radius: 8px;
  border:1px solid rgba(255,76,166,.40);
  background: linear-gradient(180deg, rgba(255,233,244,.14), rgba(255,76,166,.10));
  color:var(--text);
  cursor:pointer;
  transition:.12s ease;
  user-select:none;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 1px 0 rgba(0,0,0,.45);
}

.btn:hover{
  border-color: rgba(255,76,166,.85);
  background: linear-gradient(180deg, rgba(255,233,244,.18), rgba(255,76,166,.16));
  transform: translateY(-1px);
}

.btn:active{
  transform: translateY(0);
  background: linear-gradient(180deg, rgba(255,76,166,.18), rgba(255,233,244,.10));
  box-shadow: inset 0 2px 6px rgba(0,0,0,.55);
}

.btn.primary{
  border-color: rgba(255,76,166,.95);
  background: linear-gradient(180deg, rgba(255,233,244,.22), rgba(255,76,166,.22));
}
.btn.primary:hover{
  background: linear-gradient(180deg, rgba(255,233,244,.28), rgba(255,76,166,.28));
}

.btn.danger{
  border-color: rgba(255,59,59,.65);
  background: linear-gradient(180deg, rgba(255,233,244,.12), rgba(255,59,59,.16));
}
.btn.danger:hover{
  border-color: rgba(255,59,59,.95);
  background: linear-gradient(180deg, rgba(255,233,244,.16), rgba(255,59,59,.22));
}

.badge{
  padding:4px 8px;
  border-radius: 999px;
  border:1px solid rgba(255,76,166,.35);
  background: rgba(255,76,166,.14);
  color:var(--text);
  font-size:12px;
}

/* ======= Grid unchanged ======= */
.grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:14px;
}
@media (max-width: 900px){
  .grid{grid-template-columns:1fr}
}

/* ======= Loader: black/pink splash ======= */
#loader{
  position:fixed; inset:0;
  background:
    radial-gradient(900px 500px at 30% 20%, rgba(255,76,166,.18), transparent 65%),
    radial-gradient(900px 500px at 75% 10%, rgba(255,134,200,.12), transparent 60%),
    linear-gradient(180deg, #120812, #050507);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  transition: opacity .35s ease, visibility .35s ease;
}
#loader.hide{opacity:0; visibility:hidden}

.loader-box{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:22px 24px;
  border:1px solid rgba(255,76,166,.45);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(35,35,45,.95), rgba(15,15,22,.95));
  box-shadow: 0 12px 40px rgba(0,0,0,.75);
}
.spinner{
  width:40px; height:40px; border-radius:50%;
  border:3px solid rgba(255,233,244,.18);
  border-top-color: rgba(255,76,166,.95);
  animation: spin 1s linear infinite;
}
@keyframes spin {to{transform:rotate(360deg)}}

/* ======= Swipe cards ======= */
.deck{position:relative; min-height:540px}

.card{
  position:absolute; inset:0;
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(18,18,26,.98), rgba(10,10,15,.98));
  border:1px solid rgba(255,76,166,.30);
  box-shadow: var(--shadow);
  overflow:hidden;
  transform: translateY(var(--y,0px)) scale(var(--s,1));
  transition: transform .18s ease, opacity .18s ease;
}

.card .media{
  height:66%;
  background:
    linear-gradient(180deg, rgba(255,76,166,.18), rgba(0,0,0,0)),
    rgba(255,76,166,.06);
  border-bottom:1px solid rgba(255,76,166,.22);
}
.card img{width:100%; height:100%; object-fit:cover; display:block}
.card .info{padding:12px}
.card .title{display:flex; align-items:center; justify-content:space-between; gap:10px}

.pill{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,76,166,.30);
  color:var(--text);
  background: rgba(255,76,166,.10);
}

/* Action buttons */
.actions{
  display:flex; gap:12px; justify-content:center; padding:12px;
}
.circle{
  width:54px; height:54px; border-radius: 14px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(255,76,166,.35);
  background: linear-gradient(180deg, rgba(255,233,244,.14), rgba(255,76,166,.10));
  cursor:pointer;
  transition:.12s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 1px 0 rgba(0,0,0,.55);
}
.circle:hover{
  transform: translateY(-1px);
  border-color: rgba(255,76,166,.95);
  background: linear-gradient(180deg, rgba(255,233,244,.18), rgba(255,76,166,.16));
}
.circle:active{
  transform: translateY(0px);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65);
}
.circle.pass:hover{border-color: rgba(255,59,59,.90)}
.circle.like:hover{border-color: rgba(255,76,166,.95)}
.big{font-size:22px}

/* ======= Photos grid ======= */
.photos{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
@media (max-width: 520px){ .photos{grid-template-columns: repeat(2,1fr)} }

.photo{
  border:1px solid rgba(255,76,166,.28);
  border-radius: 10px;
  overflow:hidden;
  background: rgba(12,12,18,.92);
  position:relative;
  box-shadow: 0 6px 18px rgba(0,0,0,.55);
}
.photo img{width:100%; height:140px; object-fit:cover; display:block}

.photo .tools{
  position:absolute; inset:auto 8px 8px 8px;
  display:flex; gap:8px; justify-content:space-between;
}
.smallbtn{
  padding:7px 9px;
  border-radius: 8px;
  border:1px solid rgba(255,76,166,.35);
  background: linear-gradient(180deg, rgba(255,233,244,.14), rgba(255,76,166,.10));
  color:var(--text);
  font-size:12px;
  cursor:pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.smallbtn:hover{border-color: rgba(255,76,166,.95)}

/* ======= Chat ======= */
.chat{
  height:540px;
  display:flex;
  flex-direction:column;
}
.chat-log{
  flex:1;
  overflow:auto;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;

  background: rgba(10,10,15,.95);
  border:1px solid rgba(255,76,166,.22);
  border-radius: 10px;
  margin: 0 12px 12px 12px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.55);
}
.bubble{
  max-width: 78%;
  padding:9px 10px;
  border-radius: 10px;
  border:1px solid rgba(255,76,166,.22);
  background: rgba(255,233,244,.06);
  color:var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.me{
  margin-left:auto;
  border-color: rgba(255,76,166,.55);
  background: rgba(255,76,166,.18);
}
.chat-box{
  border-top:1px solid rgba(255,76,166,.18);
  padding:12px;
  display:flex;
  gap:10px;
  background: linear-gradient(180deg, rgba(35,35,45,.96), rgba(18,18,26,.96));
}
.chat-box input{
  flex:1;
  border-radius: 8px;
}
/* ===========================
   Mobile fix: stop card stacking over Like/Pass
   =========================== */
.discover-panel{ overflow: visible; } /* allow sticky bar to render outside panel */

@media (max-width: 520px){

  /* Make the deck fit the phone viewport better */
  .deck{
    min-height: 0;
    height: calc(100dvh - 310px); /* tweak if needed */
    max-height: 560px;
  }

  /* Reduce card height so it doesn't sit on top of the action area visually */
  .card{
    inset: 0 0 86px 0; /* reserve space at bottom inside the deck */
  }

  /* Less giant media area on mobile */
  .card .media{ height: 58%; }

  /* Tighten content so it wraps nicer */
  .card .info{ padding: 10px; }
  .card .title{ align-items:flex-start; gap:8px; }
  .pill{
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Make the actions bar sticky and not visually glued to the card */
  .actions{
    position: sticky;
    bottom: calc(10px + env(safe-area-inset-bottom));
    margin-top: 12px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom)) 10px;
    z-index: 60;

    /* Give it a bar feel so it’s clearly separate from the card */
    background: linear-gradient(180deg, rgba(10,10,15,.0), rgba(10,10,15,.85));
    border-radius: 14px;
    backdrop-filter: blur(6px);
  }

  .circle{ width:50px; height:50px; border-radius:14px; }

  /* Make “View profile” not awkward on mobile */
  .card .info a.btn{ width:100%; }
}

