/*==================================================
MONSTERCODEX
==================================================*/

:root{

--bg:#0d1117;
--panel:#161b22;
--panel2:#21262d;
--border:#30363d;

--text:#f0f6fc;
--muted:#b1bac4;

--red:#d32f2f;
--green:#22c55e;
--orange:#f59e0b;
--blue:#3b82f6;

--radius:12px;

}

/*==================================================
RESET
==================================================*/

*{
margin:0;
padding:0;
box-sizing:border-box;
}

html{
scroll-behavior:smooth;
}

body{
background:var(--bg);
color:var(--text);
font-family:'Inter',sans-serif;
line-height:1.6;
}

img{
display:block;
max-width:100%;
}

a{
text-decoration:none;
color:inherit;
}

ul{
list-style:none;
}

/*==================================================
HEADINGS
==================================================*/

h1,h2,h3,h4{
font-family:'Cinzel',serif;
font-weight:700;
}

h1{
font-size:2.6rem;
}

h2{
font-size:2rem;
margin-bottom:10px;
}

p{
color:var(--muted);
}

/*==================================================
NAVBAR
==================================================*/

.navbar{
display:flex;
justify-content:space-between;
align-items:center;
padding:18px 40px;
background:#0b0f14;
border-bottom:1px solid var(--border);
position:sticky;
top:0;
z-index:999;
}

.logo{
font-size:1.6rem;
font-family:'Cinzel',serif;
font-weight:bold;
color:white;
}

.nav-links{
display:flex;
gap:28px;
}

.nav-links a{
font-weight:600;
transition:.25s;
}

.nav-links a:hover{
color:var(--red);
}

/*==================================================
BUTTONS
==================================================*/

.button{
display:inline-block;
padding:10px 20px;
background:var(--red);
color:white;
border-radius:8px;
font-weight:600;
transition:.25s;
}

.button:hover{
transform:translateY(-2px);
box-shadow:0 10px 25px rgba(211,47,47,.35);
}

/*==================================================
HERO
==================================================*/

.hero{
padding:120px 20px;
text-align:center;
background:url(images/hero.jpg) center/cover;
position:relative;
}

.hero::before{
content:"";
position:absolute;
inset:0;
background:rgba(0,0,0,.65);
}

.hero-content{
position:relative;
max-width:850px;
margin:auto;
z-index:2;
}

.hero h1{
font-size:4rem;
margin-bottom:20px;
}

.hero p{
font-size:1.2rem;
margin-bottom:30px;
color:#d6d6d6;
}

.search-container{
position:relative;
width:100%;
max-width:700px;
margin:auto;
}

#search{
width:100%;
padding:18px 24px;
background:#1c2128;
border:2px solid var(--red);
border-radius:40px;
color:white;
font-size:1rem;
outline:none;
transition:.25s;
}

#search:focus{
transform:scale(1.02);
}

#search-results{
position:absolute;
top:calc(100% + 8px);
left:0;
width:100%;
background:var(--panel);
border:1px solid var(--border);
border-radius:12px;
overflow:hidden;
display:none;
z-index:9999;
box-shadow:0 15px 35px rgba(0,0,0,.5);
}

.search-item{
display:flex;
align-items:center;
gap:12px;
padding:14px;
cursor:pointer;
border-bottom:1px solid var(--border);
transition:.2s;
}

.search-item:last-child{
border-bottom:none;
}

.search-item:hover{
background:#242b34;
}

.search-item img{
width:48px;
height:48px;
object-fit:cover;
border-radius:6px;
}

.search-item h4{
font-family:'Inter',sans-serif;
margin:0;
}

.search-item p{
font-size:.85rem;
}

/*==================================================
SECTION TITLES
==================================================*/

.section-title{
text-align:center;
margin:70px 0 35px;
}

.section-title h2{
margin-bottom:8px;
}

.section-title p{
font-size:1rem;
color:var(--muted);
}

/*==================================================
CATEGORY GRID
==================================================*/

.categories{
max-width:1400px;
margin:0 auto;
padding:20px;
}

.category-grid{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
gap:18px;
}

.category{
background:var(--panel);
border:1px solid var(--border);
border-radius:12px;
padding:18px;
text-align:center;
font-weight:600;
cursor:pointer;
transition:.25s;
user-select:none;
}

.category:hover{
background:#1d232c;
border-color:var(--red);
transform:translateY(-4px);
}

.category.active{
background:var(--red);
border-color:var(--red);
color:white;
}

/*==================================================
FEATURED MONSTERS
==================================================*/

.featured{
max-width:1400px;
margin:0 auto;
padding:20px;
}

.monster-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
gap:24px;
}

/*==================================================
MONSTER CARD
==================================================*/

.card{
background:var(--panel);
border:1px solid var(--border);
border-radius:14px;
overflow:hidden;
transition:.3s;
display:flex;
flex-direction:column;
}

.card:hover{
transform:translateY(-8px);
border-color:var(--red);
box-shadow:0 18px 40px rgba(0,0,0,.45);
}

.card img{
width:100%;
height:270px;
object-fit:cover;
}

.card-content{
display:flex;
flex-direction:column;
padding:18px;
flex:1;
}

.card-content h3{
font-size:1.25rem;
margin-bottom:8px;
}

.card-content p{
font-size:.9rem;
margin-bottom:12px;
}

.card .button{
margin-top:auto;
text-align:center;
}

/*==================================================
THREAT BADGES
==================================================*/

.threat{
display:inline-flex;
align-items:center;
justify-content:center;
padding:7px 14px;
border-radius:999px;
font-size:.85rem;
font-weight:700;
margin-bottom:15px;
width:max-content;
}

.threat.extreme{
background:#7f1d1d;
color:#fff;
}

.threat.high{
background:#b45309;
color:#fff;
}

.threat.medium{
background:#1d4ed8;
color:#fff;
}

.threat.low{
background:#166534;
color:#fff;
}

.threat.unknown{
background:#374151;
color:#fff;
}

/*==================================================
FOOTER
==================================================*/

footer{
margin-top:80px;
padding:30px;
text-align:center;
border-top:1px solid var(--border);
color:var(--muted);
background:#0b0f14;
}

/*==================================================
MONSTER PROFILE
==================================================*/

.monster-profile{
max-width:1400px;
margin:50px auto;
padding:0 20px;
}

.profile-top{
display:grid;
grid-template-columns:400px 1fr;
gap:45px;
align-items:start;
}

/*==================================================
LEFT COLUMN
==================================================*/

.profile-left{
display:flex;
flex-direction:column;
align-items:center;
}

#monster-image{
width:100%;
aspect-ratio:3/4;
object-fit:cover;
border:2px solid var(--red);
border-radius:14px;
background:#111;
margin-bottom:18px;
}


/*==================================================
RIGHT COLUMN
==================================================*/

.profile-right{
display:flex;
flex-direction:column;
gap:15px;
}

.profile-right h1{
font-size:2.5rem;
margin:0;
}

.monster-intro{
font-size:1rem;
line-height:1.8;
color:var(--muted);
}

/*==================================================
INFO TABLE
==================================================*/

.monster-table{
width:100%;
border-collapse:collapse;
background:var(--panel);
border-radius:12px;
overflow:hidden;
}

.monster-table tr:nth-child(even){
background:#1b2129;
}

.monster-table th{
width:180px;
padding:10px 16px;
text-align:left;
background:#20262e;
font-weight:600;
}

.monster-table td{
padding:10px 16px;
}

/*==================================================
ABILITY / WEAKNESS CARDS
==================================================*/

.profile-bottom{
display:grid;
grid-template-columns:1fr 1fr;
gap:20px;
}

.profile-section{
background:var(--panel);
border:1px solid var(--border);
border-radius:12px;
padding:18px;
}

.profile-section h2{
display:flex;
align-items:center;
gap:10px;
font-size:1.1rem;
margin-bottom:15px;
padding-bottom:10px;
border-bottom:2px solid var(--red);
}

#monster-abilities,
#monster-weaknesses{
display:flex;
flex-direction:column;
gap:10px;
}

#monster-abilities li,
#monster-weaknesses li{
display:flex;
align-items:center;
gap:10px;
padding:8px 12px;
background:var(--panel2);
border:1px solid var(--border);
border-radius:8px;
font-size:.9rem;
transition:.25s;
}

#monster-abilities li:hover{
background:#123524;
border-color:var(--green);
}

#monster-weaknesses li:hover{
background:#5a1a1a;
border-color:#ef4444;
}

.ability-icon,
.weakness-icon{
width:30px;
height:30px;
display:flex;
justify-content:center;
align-items:center;
border-radius:50%;
flex-shrink:0;
}

.ability-icon{
background:#14532d;
}

.weakness-icon{
background:#7f1d1d;
}

/*==================================================
RELATED MONSTERS
==================================================*/

.related-grid{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:18px;
margin-top:15px;
}

/*==================================================
RETURN BUTTON
==================================================*/

.back-home{
text-align:center;
margin:45px 0;
}

/*==================================================
MOBILE
==================================================*/

@media(max-width:950px){

.profile-top{
grid-template-columns:1fr;
}

.profile-left{
max-width:340px;
margin:auto;
}

.profile-bottom{
grid-template-columns:1fr;
}

.profile-right h1{
font-size:2rem;
}

.monster-table th{
width:130px;
}

}

/*==================================================
RANDOM ENCOUNTER
==================================================*/

#encounter-screen{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
display:none;
justify-content:center;
align-items:center;
background:rgba(0,0,0,.85);
backdrop-filter:blur(4px);
z-index:99999;
}

.encounter-box{
width:420px;
max-width:90%;
padding:40px;
background:#161b22;
border:2px solid #d32f2f;
border-radius:14px;
text-align:center;
box-shadow:0 0 40px rgba(211,47,47,.45);
}

.encounter-box h2{
margin-bottom:20px;
}

.encounter-box p{
margin-bottom:25px;
color:#b1bac4;
}

.loading-bar{
height:10px;
background:#30363d;
border-radius:20px;
overflow:hidden;
}

.loading-fill{
width:0;
height:100%;
background:#d32f2f;
animation:loading 2s linear forwards;
}

@keyframes loading{

from{
width:0%;
}

to{
width:100%;
}

}

/*==================================================
LOADING BAR
==================================================*/

.loading-bar{
width:100%;
height:12px;
background:#2b3139;
border-radius:999px;
overflow:hidden;
}

.loading-fill{
width:0;
height:100%;
background:var(--red);
animation:loading 1.5s linear forwards;
}

@keyframes loading{

from{
width:0%;
}

to{
width:100%;
}

}

/*==================================================
GENERAL ANIMATIONS
==================================================*/

.button,
.card,
.category,
.profile-section,
.gallery img,
#monster-image{
transition:.25s;
}

.card:hover{
transform:translateY(-8px);
}

.category:hover{
transform:translateY(-5px);
}

.profile-section:hover{
border-color:var(--red);
}

.gallery img:hover{
transform:scale(1.08);
}

#monster-image:hover{
box-shadow:0 0 35px rgba(211,47,47,.35);
}

/*==================================================
SCROLLBAR
==================================================*/

::-webkit-scrollbar{
width:10px;
}

::-webkit-scrollbar-track{
background:#0d1117;
}

::-webkit-scrollbar-thumb{
background:#3a3f46;
border-radius:20px;
}

::-webkit-scrollbar-thumb:hover{
background:var(--red);
}

/*==================================================
UTILITY
==================================================*/

.hidden{
display:none!important;
}

.center{
text-align:center;
}

.mt20{
margin-top:20px;
}

.mt30{
margin-top:30px;
}

.mb20{
margin-bottom:20px;
}

.mb30{
margin-bottom:30px;
}

/*==================================================
RESPONSIVE
==================================================*/

@media(max-width:1200px){

.monster-grid{
grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
}

}

@media(max-width:900px){

.navbar{
flex-direction:column;
gap:15px;
padding:20px;
}

.nav-links{
flex-wrap:wrap;
justify-content:center;
gap:18px;
}

.hero{
padding:90px 20px;
}

.hero h1{
font-size:2.8rem;
}

.monster-grid{
grid-template-columns:1fr;
}

.category-grid{
grid-template-columns:repeat(2,1fr);
}

}

@media(max-width:600px){

.hero h1{
font-size:2.2rem;
}

.category-grid{
grid-template-columns:1fr;
}

.profile-left{
max-width:300px;
}

.profile-right h1{
font-size:1.8rem;
}

.monster-table th,
.monster-table td{
padding:10px;
font-size:.9rem;
}

.gallery img{
width:60px;
height:60px;
}

.button{
width:100%;
text-align:center;
}

}
