*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Arial,sans-serif;
}

:root{
--bg:#f5f5f5;
--card:#fff;
--text:#222;
--accent:#5b4bff;
}

body.dark{
--bg:#111;
--card:#1c1c1c;
--text:#fff;
}

body{
background:var(--bg);
color:var(--text);
transition:.3s;
}

.container{
width:min(1200px,92%);
margin:auto;
}

header{
background:var(--card);
padding:18px 0;
position:sticky;
top:0;
box-shadow:0 2px 10px rgba(0,0,0,.08);
z-index:10;
}

.nav{
display:flex;
justify-content:space-between;
align-items:center;
}

#themeToggle{
border:none;
background:var(--bg);
padding:10px;
border-radius:50%;
cursor:pointer;
}

.controls{
display:flex;
justify-content:space-between;
align-items:center;
gap:15px;
flex-wrap:wrap;
margin:30px 0;
}

.filters{
display:flex;
gap:10px;
flex-wrap:wrap;
}

.filter-btn{
padding:10px 18px;
border:none;
border-radius:25px;
cursor:pointer;
background:var(--card);
color:var(--text);
}

.filter-btn.active{
background:var(--accent);
color:white;
}

#searchInput{
padding:10px 15px;
border-radius:25px;
border:1px solid #ccc;
width:220px;
}

.gallery{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
gap:20px;
padding-bottom:40px;
}

.gallery-item{
height:260px;
overflow:hidden;
border-radius:15px;
cursor:pointer;
position:relative;
}

.gallery-item img{
width:100%;
height:100%;
object-fit:cover;
transition:.4s;
}

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

.gallery-item::after{
content:"View";
position:absolute;
inset:0;
display:flex;
justify-content:center;
align-items:center;
background:rgba(0,0,0,.45);
color:white;
font-size:18px;
opacity:0;
transition:.3s;
}

.gallery-item:hover::after{
opacity:1;
}

.lightbox{
position:fixed;
inset:0;
background:rgba(0,0,0,.92);
display:none;
justify-content:center;
align-items:center;
z-index:100;
}

.lightbox.active{
display:flex;
}

.lightbox-content{
text-align:center;
max-width:85%;
}

.lightbox-content img{
max-width:100%;
max-height:75vh;
border-radius:10px;
}

.lightbox-content p{
color:white;
margin-top:12px;
}

.close-btn,
.nav-btn{
position:absolute;
background:none;
border:none;
color:white;
cursor:pointer;
}

.close-btn{
top:20px;
right:30px;
font-size:40px;
}

.nav-btn{
top:50%;
transform:translateY(-50%);
font-size:35px;
}

.prev{left:20px;}
.next{right:20px;}

footer{
text-align:center;
padding:20px;
background:var(--card);
}