/* =========================
GLOBAL RESET
========================= */

*{
margin:0;
padding:0;
box-sizing:border-box;
}

body{
font-family:Arial,Helvetica,sans-serif;
background:#f5f7f6;
color:#222;
line-height:1.6;
}

a{
text-decoration:none;
color:inherit;
}

img{
max-width:100%;
display:block;
height:auto;
}

/* =========================
LAYOUT
========================= */

.container{
width:95%;
max-width:1250px;
margin:auto;
padding:0 10px;
}

.section{
padding:40px 0;
}

.section-title{
font-size:28px;
margin-bottom:20px;
color:#111;
}

/* =========================
HEADER
========================= */

.header{
background:#fff;
border-bottom:1px solid #e5e5e5;
position:sticky;
top:0;
z-index:1000;
}

.header-inner{
display:flex;
align-items:center;
justify-content:space-between;
padding:16px 0;
flex-wrap:wrap;
}

.logo{
font-size:24px;
font-weight:bold;
color:#25D366;
}

.nav{
display:flex;
gap:20px;
align-items:center;
flex-wrap:wrap;
}

.nav a{
font-weight:600;
color:#333;
}

/* =========================
BUTTONS
========================= */

.btn{
display:inline-block;
background:#25D366;
color:#fff;
padding:12px 20px;
border-radius:8px;
border:none;
cursor:pointer;
font-weight:bold;
}

.btn:hover{
opacity:0.9;
}

.btn-outline{
background:#fff;
color:#25D366;
border:2px solid #25D366;
}

/* =========================
HERO
========================= */

.hero{
background:linear-gradient(135deg,#0e2d1e,#0b1f15);
color:#fff;
padding:70px 20px;
border-radius:20px;
margin:30px 0;
text-align:center;
}

.hero h1{
font-size:42px;
margin-bottom:15px;
}

.hero p{
font-size:18px;
color:#d8e6dd;
margin-bottom:25px;
}

/* =========================
SEARCH
========================= */

.search-box{
display:flex;
gap:10px;
max-width:700px;
margin:auto;
}

.search-box input,
.search-box select,
.form-control{
width:100%;
padding:14px;
border:1px solid #d9dfdb;
border-radius:10px;
font-size:15px;
outline:none;
}

/* =========================
GRID SYSTEM
========================= */

.grid{
display:grid;
gap:22px;
}

.groups-grid{
grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
}

.categories-grid{
grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
}

/* =========================
CATEGORY CARD
========================= */

.category-card{
background:#fff;
border-radius:14px;
padding:18px;
border:1px solid #ebefec;
box-shadow:0 4px 14px rgba(0,0,0,0.04);
text-align:center;
font-weight:600;
}

/* =========================
GROUP CARD
========================= */

.group-card{
background:#fff;
border-radius:18px;
overflow:hidden;
border:1px solid #e6ece9;
box-shadow:0 8px 22px rgba(0,0,0,0.05);
transition:0.3s;
display:flex;
flex-direction:column;
cursor:pointer;
}

.group-card:hover{
transform:translateY(-6px);
box-shadow:0 14px 28px rgba(0,0,0,0.08);
}

.group-thumb{
width:100%;
height:180px;
overflow:hidden;
background:#f4f7f5;
display:flex;
align-items:center;
justify-content:center;
border-radius:14px;
margin-bottom:12px;
}

.group-thumb img{
width:100%;
height:100%;
object-fit:cover;
object-position:center;
background:#fff;
padding:6px;
}

.group-card h3{
font-size:20px;
margin:8px 0 6px;
line-height:1.4;
}

.group-card p{
font-size:14px;
color:#555;
margin-bottom:12px;
}

.group-card .btn{
margin-top:auto;
align-self:flex-start;
}

.badge{
display:inline-block;
background:#eafaf0;
color:#1f9f51;
padding:5px 10px;
font-size:12px;
border-radius:20px;
margin-bottom:10px;
}

/* =========================
ADS
========================= */

.ad-box{
background:#eef7f1;
border:2px dashed #a9d8ba;
padding:20px;
text-align:center;
border-radius:14px;
color:#2d6d45;
}

/* =========================
TABLE
========================= */

.table{
width:100%;
border-collapse:collapse;
background:#fff;
}

.table th,
.table td{
padding:12px;
border:1px solid #e8ece9;
text-align:left;
}

/* =========================
PAGINATION
========================= */

.pagination{
display:flex;
gap:8px;
margin-top:25px;
flex-wrap:wrap;
}

.pagination a{
padding:10px 14px;
border-radius:8px;
background:#fff;
border:1px solid #ddd;
}

.pagination a.active{
background:#25D366;
color:#fff;
border-color:#25D366;
}

/* =========================
SIDEBAR
========================= */

.sidebar-layout{
display:grid;
grid-template-columns:3fr 1fr;
gap:25px;
}

.small-muted{
color:#777;
font-size:14px;
}

.dark-toggle{
cursor:pointer;
padding:8px 12px;
border-radius:8px;
background:#f1f1f1;
transition:.2s;
}

.dark-toggle:hover{
background:#e5e5e5;
}

/* =========================
FOOTER
========================= */

.footer{
background:#fff;
border-top:1px solid #e5e5e5;
margin-top:40px;
padding:40px 0;
}

.footer-grid{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
gap:25px;
}

.footer h4{
margin-bottom:15px;
}

.footer a{
display:block;
margin-bottom:8px;
color:#555;
}

/* =========================
MODAL
========================= */

.modal-overlay{
position:fixed;
inset:0;
background:rgba(0,0,0,0.55);
display:none;
align-items:center;
justify-content:center;
padding:20px;
z-index:9999;
}

.modal-overlay.active{
display:flex;
}

.modal-box{
background:#fff;
width:100%;
max-width:700px;
border-radius:18px;
box-shadow:0 20px 50px rgba(0,0,0,0.18);
position:relative;
overflow:hidden;
}

.modal-box h2{
font-size:26px;
padding:22px 24px 10px;
border-bottom:1px solid #edf1ee;
}

.modal-content{
padding:20px 24px 24px;
max-height:70vh;
overflow-y:auto;
}

.modal-close{
position:absolute;
top:12px;
right:14px;
width:40px;
height:40px;
border:none;
border-radius:50%;
background:#f2f5f3;
font-size:26px;
cursor:pointer;
}

/* =========================
DARK MODE
========================= */

body.dark{
background:#121212;
color:#f5f5f5;
}

body.dark .header,
body.dark .footer,
body.dark .group-card,
body.dark .category-card,
body.dark .table{
background:#1e1e1e;
border-color:#333;
color:#fff;
}

body.dark .nav a,
body.dark .footer a,
body.dark .small-muted{
color:#ccc;
}

/* =========================
RESPONSIVE
========================= */

@media (max-width:992px){

.sidebar-layout{
grid-template-columns:1fr;
}

}

@media (max-width:768px){

.header-inner{
flex-direction:column;
gap:10px;
}

.nav{
justify-content:center;
}

.hero h1{
font-size:30px;
}

.hero p{
font-size:16px;
}

.search-box{
flex-direction:column;
}

.footer-grid{
grid-template-columns:1fr 1fr;
}

.groups-grid{
grid-template-columns:1fr;
}

}

@media (max-width:480px){

.hero h1{
font-size:26px;
}

.group-thumb{
height:140px;
}

.footer-grid{
grid-template-columns:1fr;
}

.modal-box{
border-radius:14px;
}

}