html, body {
    max-width: 100%;
    overflow-x: hidden; /* This prevents the site from moving to the right */
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box; /* Ensures padding doesn't push elements wider */
}
/* GLOBAL STYLES */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4cc9f0;
  --warning: #f72585;
  --green: #25D366;
  --gray: #6c757d;
  --light-gray: #e9ecef;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body { background: #f0f2f5; color: #333; line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }

/* --- HEADER DESKTOP --- */
header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: sticky; top: 0; z-index: 1000;
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; z-index: 1002; }
.logo img { height: 45px; width: 45px; border-radius: 50%; object-fit: cover; border: 2px solid white; }
.logo span { font-size: 1.5rem; font-weight: 700; color: white; }

/* --- DESKTOP NAVIGATION --- */
nav { 
    display: flex; 
    align-items: center;
    flex: 1; 
    justify-content: center; 
}
nav ul { display: flex; list-style: none; gap: 25px; margin: 0; padding: 0; }
nav a { color: rgba(255, 255, 255, 0.9); text-decoration: none; font-weight: 500; font-size: 16px; transition: var(--transition); padding: 5px 0; display: flex; align-items: center; gap: 6px; position: relative; }
nav a:hover, nav a.active { color: white; }
nav a.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--success); }

/* Hide Mobile Elements on Desktop */
.mobile-menu-toggle { display: none !important; }
.close-menu-btn { display: none !important; }

/* Header Right Side */
.header-right { display: flex; align-items: center; gap: 15px; }
.header-actions { display: flex; gap: 15px; align-items: center; }
.header-button { background-color: var(--warning); color: white; border: none; padding: 8px 18px; border-radius: 50px; font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: 0 4px 10px rgba(247, 37, 133, 0.3); display: flex; align-items: center; gap: 8px; text-decoration: none; }
.login-icon { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; display:flex; align-items:center; }

/* --- CARDS (UPDATED to match reference image) --- */
#cards { 
    display: grid; 
    /* Wider cards: min 300px */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 2rem; 
    margin-top: 30px;
}

.card { 
    background: #fff; 
    border-radius: 10px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    overflow: hidden; 
    transition: var(--transition); 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    border: 1px solid #eee; /* Added subtle border like reference */
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

.card-img-container { 
    height: 200px; /* Taller Image */
    width: 100%; 
    overflow: hidden; 
    flex-shrink: 0; 
}
.card-img-container img { width: 100%; height: 100%; object-fit: cover; }

.card-content { 
    padding: 1.5rem; /* Increased padding */
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.card h3 { 
    margin: 0 0 15px 0; 
    font-size: 1.2rem; /* Larger, bolder font */
    color: var(--dark);
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta { 
    margin-top: auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: var(--gray); 
    font-size: 0.9rem;
    padding-top: 15px; 
    /* Removed top border for cleaner look */
}

/* STYLED "VIEW" BUTTON (Like "Read More") */
.view-btn {
    background-color: var(--primary);
    color: white !important;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s ease;
}
.view-btn:hover {
    background-color: var(--secondary);
}


/* OTHER STYLES */
main { padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; flex: 1; }
.section-header { text-align: center; margin-bottom: 2rem; padding-top: 10px; }
.search-container { background: white; padding: 1.5rem; border-radius: var(--border-radius); box-shadow: var(--box-shadow); margin-bottom: 2rem; }
.search-inputs { display: flex; gap: 10px; flex-wrap: wrap; }
.search-inputs select, .search-inputs input { flex: 1; min-width: 0px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem; }
.search-btn { background: var(--primary); color: white; border: none; padding: 0 20px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.whatsapp-button { background-color: var(--green) !important; color: white !important; border: none; padding: 10px 22px; border-radius: 50px; font-weight: bold; font-size: 0.95rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3); }
.whatsapp-button:hover { background-color: #128C7E !important; transform: translateY(-2px); }

/* Dropdowns & Profile */
.user-dropdown { position: relative; }
.user-dropdown-content { display: none; position: absolute; top: 100%; right: 0; background: white; min-width: 260px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); border-radius: 12px; z-index: 2002; padding: 20px; text-align: left; }
.user-dropdown.active .user-dropdown-content { display: block; }
.user-info p { margin: 0 0 10px 0; color: #555; font-size: 0.9rem; line-height: 1.4; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
.user-info p:last-child { border-bottom: none; margin-bottom: 15px; }
.user-info strong { color: var(--primary); display: inline-block; width: 60px; }
.logout-btn, .edit-profile-btn { background: var(--primary); color: white; border: none; padding: 10px; border-radius: 6px; cursor: pointer; width: 100%; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.logout-btn { background: var(--warning); margin-bottom: 0; }

/* Pagination & Footer */
.pagination { display: flex; justify-content: center; margin-top: 40px; gap: 10px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid #ddd; border-radius: 5px; text-decoration: none; color: var(--primary); background: white; font-weight: 600; font-size: 0.9rem; }
.pagination a:hover { background: var(--light); }
.pagination .current-page { background: var(--primary); color: white; border-color: var(--primary); }
footer { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 3rem 2rem 1.5rem; margin-top: auto; }
.footer-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { list-style: none; }
.footer-links a { color: rgba(255, 255, 255, 0.85); text-decoration: none; display: block; margin-bottom: 10px; }
.social-links { display: flex; gap: 15px; margin-top: 20px; }
.social-link { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; }
.copyright { text-align: center; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* Modals */
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 3000; }
.modal { background: #fff; border-radius: var(--border-radius); max-width: 450px; width: 90%; padding: 1.5rem; position: relative; max-height:90vh; overflow-y:auto; }
.close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; }
input, textarea, select { width: 100%; padding: 0.8rem; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 0.5rem; }
button[type="submit"], .btn { background: var(--primary); color: #fff; border: none; padding: 0.8rem 1.6rem; border-radius: 8px; font-weight: 600; cursor: pointer; width: 100%; }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 900px) {
    header { padding: 10px 15px; }
    .mobile-menu-toggle { display: block !important; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; margin-left: 15px; }
    .header-button span { display: none; } 
    .header-button { padding: 10px; border-radius: 50%; width: 40px; height: 40px; justify-content: center; }

    nav { position: fixed; top: 0; left: -100%; width: 280px; height: 100vh; background: white; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding-top: 60px; transition: 0.3s ease; z-index: 2000; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    nav.active { left: 0; }
    nav ul { flex-direction: column; width: 100%; gap: 0; margin-left: 0; }
    nav li { width: 100%; border-bottom: 1px solid #f0f0f0; }
    nav a { padding: 15px 20px; color: #333 !important; font-size: 1.1rem; width: 100%; }
    
    .close-menu-btn { display: block !important; position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; color: #333; cursor: pointer; }

    #cards { grid-template-columns: 1fr !important; }
    .search-inputs { flex-direction: column; }
    .footer-container { text-align: center; }
    .social-links { justify-content: center; }
}