/* --- Variables & Reset --- */
:root { 
    --brand: #0056b3; /* Professional Blue */
    --brand-hover: #004494;
    --bg: #ffffff; 
    --bg-alt: #f8f9fa;
    --card: #ffffff; 
    --text: #212529;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --whatsapp: #25D366;
    --messenger: #0084FF;
    --success: #28a745;
    --danger: #dc3545;
}

body { 
    background: var(--bg); 
    color: var(--text); 
    font-family: 'Inter', -apple-system, sans-serif; 
    margin: 0; 
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Navigation --- */
nav { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 15px 40px; 
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo a { 
    color: var(--brand); 
    font-weight: 800; 
    font-size: 1.4rem; 
    text-decoration: none; 
    letter-spacing: -0.5px; 
}

.menu a { 
    color: var(--text); 
    margin-left: 20px; 
    text-decoration: none; 
    font-size: 0.85rem; 
    font-weight: 600;
    text-transform: uppercase;
    transition: 0.3s;
}

.menu a:hover { color: var(--brand); }

/* --- Layout Sections --- */
.hero { 
    padding: 100px 20px; 
    text-align: center; 
    background: var(--bg-alt); 
    border-bottom: 1px solid var(--border);
}

.hero h1 { font-size: 3.5rem; margin: 0; color: var(--text); font-weight: 800; letter-spacing: -1.5px; }
.hero p { color: var(--text-muted); font-size: 1.2rem; margin-top: 10px; }

.template-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 30px; 
    padding: 60px 40px; 
}

/* --- Cards & Templates --- */
.card { 
    background: var(--card); 
    padding: 30px; 
    border: 1px solid var(--border); 
    border-radius: 16px; /* Modern rounding */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card:hover { 
    border-color: transparent; 
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1); 
}

.card h3 { color: var(--text); margin: 15px 0 10px 0; font-size: 1.25rem; font-weight: 700; }

.badge { 
    background: rgba(0, 86, 179, 0.1);
    color: var(--brand);
    font-size: 10px; 
    padding: 5px 12px; 
    border-radius: 6px; 
    width: fit-content;
    font-weight: 800;
    text-transform: uppercase;
}

/* --- Buttons --- */
button, .btn-main, .btn-send { 
    background: var(--brand); 
    border: none; 
    color: white; 
    padding: 14px 28px; 
    cursor: pointer; 
    text-decoration: none; 
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px; /* Fully rounded buttons */
    transition: 0.3s;
    display: inline-block;
    text-align: center;
}

button:hover, .btn-main:hover { background: var(--brand-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,86,179,0.2); }

/* --- Search & Filters (Pill Style) --- */
.filter-container { max-width: 800px; margin: 30px auto 0; padding: 0 20px; }
.search-form { display: flex; gap: 10px; justify-content: center; }
.search-form input {
    flex: 1;
    max-width: 500px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 15px 25px;
    color: var(--text);
    border-radius: 50px;
    font-size: 1rem;
    transition: 0.3s;
}
.search-form input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px rgba(0,86,179,0.1); }

.category-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 25px; }
.chip {
    padding: 10px 22px;
    background: #fff;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(0,86,179,0.2); }

/* --- Voting System --- */
.vote-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-alt);
    padding: 10px 20px;
    margin: 15px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.score { font-weight: 800; color: var(--brand); font-size: 1.1rem; }
.vote-btn { text-decoration: none; font-weight: bold; transition: 0.2s; }
.vote-btn.up { color: var(--success); }
.vote-btn.down { color: var(--danger); }

/* --- Related Templates Scroll --- */
.related-scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 40px;
    scroll-snap-type: x mandatory;
}
.related-card {
    flex: 0 0 280px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 25px;
    border-radius: 16px;
    text-decoration: none;
    transition: 0.3s;
}
.related-card:hover { border-color: var(--brand); box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.rel-tag { color: var(--brand); font-weight: 800; font-size: 10px; margin-bottom: 8px; display: block; }

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    nav { padding: 15px 20px; flex-direction: column; gap: 10px; }
    .hero h1 { font-size: 2.5rem; }
    .template-grid { padding: 20px; grid-template-columns: 1fr; }
    .search-form { flex-direction: column; }
    .search-form input, button { width: 100% !important; max-width: none; }
}