/* ================= GLOBAL ================= */

*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Poppins;
}

body{
background:linear-gradient(135deg,#0f172a,#020617);
color:white;
min-height:100vh;
transition:.3s ease;
position:relative;
}


/* ================= 3D BACKGROUND ================= */

#space-bg{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
z-index:-1; /* background */
}

/* ensure UI stays above */
nav, header, .cards{
position:relative;
z-index:2;
}


/* ================= NAVBAR ================= */

nav{
display:flex;
justify-content:space-between;
align-items:center;
padding:20px 60px;
background:rgba(255,255,255,.05);
backdrop-filter:blur(10px);
}

.logo{
font-size:22px;
font-weight:700;
display:flex;
gap:10px;
align-items:center;
}

#toggle-mode{
padding:8px 14px;
border:none;
border-radius:20px;
cursor:pointer;
font-size:16px;
background:#111827;
color:white;
}


/* ================= HEADER ================= */

header{
text-align:center;
margin-top:40px;
}

header h1{
font-size:48px;
text-shadow:0px 0px 25px #3b82f6;
}

header p{
opacity:.8;
margin:15px;
}


/* ================= SEARCH ================= */

.search-box{
margin-top:30px;
display:flex;
justify-content:center;
align-items:center;
gap:10px;
}

.input-wrapper{
position:relative;
}

.input-wrapper input{

width:450px;
padding:18px 18px 18px 50px;

border-radius:32px;
border:none;

background:#020617;
color:white;

box-shadow:
0px 0px 15px #2563eb,
inset 0px 0px 10px black;

}

.input-wrapper input:focus{

outline:none;

box-shadow:
0px 0px 25px #60a5fa,
inset 0px 0px 15px black;

}

.input-wrapper i{

position:absolute;
left:15px;
top:50%;
transform:translateY(-50%);
color:#60a5fa;

}


/* ================= BUTTON ================= */

.search-box button{

padding:15px 35px;
border-radius:40px;
background:linear-gradient(90deg,#2563eb,#22c55e);
border:none;
color:white;
font-weight:600;
cursor:pointer;

}


/* ================= SUGGESTIONS ================= */

#suggestions{
position:absolute;
top:110%;
left:0;
width:100%;

background:#020617;
color:white;

border-radius:16px;

list-style:none;

box-shadow:0px 15px 30px rgba(0,0,0,.45);

/* 🔥 FIX */
z-index:9999;

max-height:240px;
overflow-y:auto;
padding:6px 0;
}
.input-wrapper{
  position:relative;
}

#suggestions:empty{
display:none;
}

#suggestions li{

padding:14px 20px;
cursor:pointer;
transition:.2s ease;

}

#suggestions li:hover{
background:#1e293b;
}

#suggestions {
  isolation: isolate;
}
/* ================= CARDS ================= */

.cards{

display:flex;
gap:25px;
margin:60px;
justify-content:center;
flex-wrap:wrap;

}
nav, header {
  position: relative;
  z-index: 10;
}

.cards {
  position: relative;
  z-index: 1;
}
.card{

width:300px;
max-width:100%;

padding:32px;

border-radius:22px;

background:rgba(255,255,255,.05);

backdrop-filter:blur(18px);

box-shadow:
0px 12px 30px rgba(0,0,0,.25),
inset 0px 0px 10px rgba(255,255,255,.05);

transition:.3s ease;

}

.card:hover{
transform:translateY(-6px);
}


/* ================= PROFILE ================= */

.result{
text-align:center;
}

.result img{
width:120px;
border-radius:50%;
margin-bottom:15px;
}


/* ================= DATA PREVIEW ================= */

#previewPlaceholder{
text-align:center;
opacity:.85;
margin-top:40px;
}


/* ================= VISIT PROFILE BUTTON ================= */

.visit-btn{

display:inline-flex;
align-items:center;
gap:8px;

margin-top:18px;
padding:12px 30px;

font-size:15px;
font-weight:600;

border:none;
border-radius:40px;

color:white;
text-decoration:none;

background:linear-gradient(
135deg,
#2563eb,
#22c55e
);

box-shadow:
0px 4px 18px rgba(37,99,235,.45),
0px 2px 10px rgba(34,197,94,.25);

transition:all .25s ease;

cursor:pointer;

}

.visit-btn:hover{

transform:translateY(-3px);

box-shadow:
0px 10px 28px rgba(37,99,235,.7),
0px 6px 20px rgba(34,197,94,.45);

}


/* ================= REPO CARDS ================= */

.repo-card{

margin-top:15px;
padding:14px;

border-radius:14px;

background:rgba(255,255,255,.05);

transition:.25s ease;

}

.repo-card:hover{

transform:translateY(-5px);

box-shadow:
0px 14px 38px rgba(0,0,0,.25);

cursor:pointer;

}


/* ================= SKELETON LOADING ================= */

.skeleton{

display:flex;
flex-direction:column;

align-items:center;

gap:12px;

margin-top:15px;

}

.skeleton-avatar{

width:80px;
height:80px;

border-radius:50%;

background:linear-gradient(
90deg,
#1e293b,
#334155,
#1e293b
);

animation:skeletonLoading 1.2s infinite linear;

}

.skeleton-text{

width:160px;
height:12px;

border-radius:6px;

background:linear-gradient(
90deg,
#1e293b,
#334155,
#1e293b
);

animation:skeletonLoading 1.2s infinite linear;

}

.skeleton-text.short{
width:110px;
}

@keyframes skeletonLoading{

0%{
background-position:-200px;
}

100%{
background-position:200px;
}

}

.skeleton-avatar,
.skeleton-text {
background-size: 400px 100%;
}


/* ================= LIGHT MODE ================= */

.light{
background:white;
color:black;
}

.light nav{
background:#eee;
}

.light .card{
background:white;
}

.light header h1{
text-shadow:none;
color:#111827;
}

.light .input-wrapper input{

background:white;
color:black;

box-shadow:
0px 0px 12px rgba(0,0,0,.15),
inset 0px 0px 6px rgba(0,0,0,.05);

}

.light #suggestions{

background:white;
color:#111827;
border:1px solid rgba(0,0,0,.08);

}

.light #suggestions li:hover{

background:#e5e7eb;
color:#111827;

}

/* repo fix light */
.light .repo-card{

background:white;

border:1px solid rgba(0,0,0,.08);

box-shadow:
0px 8px 24px rgba(0,0,0,.12);

}

/* toggle button */
.light #toggle-mode{

background:#e5e7eb;
color:black;

}

#suggestions li.active{
  background:#2563eb;
  color:white;
}

.preview-list{
  list-style:none;
  padding:0;
  margin-top:15px;
}

.preview-list li{
  position:relative;
  padding-left:18px;
  margin:8px 0;
  text-align:left;
}

.preview-list li::before{
  content:"•";
  position:absolute;
  left:0;
  color:#60a5fa;
}

.preview canvas{
  max-width:100%;
  margin:20px auto 0;
  display:block;
}

#repoList{
  display:flex;
  flex-direction:column;
  gap:12px;
}