:root {
    --primary: #10b981;
    --secondary: #1e3a8a;
    --dark: #0f172a;
    --light: #f8fafc;
    --accent: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    padding: 80px 10%;
}

.text-center {
    text-align: center;
}

/* Nav */
nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 5%;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.logo {
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
    font-size: 1.5rem;
}

.candidate-tag {
    background: var(--accent);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

/* Hero */
/* Update the Hero Background */
.hero {
    height: 100vh;
    /* Replace 'shinaan-photo.jpg' with your actual image file name */
    background: linear-gradient(rgba(30, 58, 138, 0.7), rgba(16, 185, 129, 0.5)),
        url('images/shinaan-photo.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* Timer */
.timer {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.timer-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    min-width: 50px;
}

.timer-box span {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.election-date {
    margin-top: 20px;
    font-weight: bold;
    color: var(--accent);
}

/* Grid Layouts */
.section-title {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 40px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.bio-features .feature {
    background: var(--light);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 5px solid var(--primary);
}

.bio-image img {
    width: 100%;
    border-radius: 20px;
}

.values-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.v-card {
    background: var(--secondary);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: bold;
}

.commitments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.c-item {
    background: var(--light);
    padding: 30px;
    border-radius: 15px;
    transition: 0.3s;
    text-align: center;
    border-bottom: 4px solid var(--primary);
}

.c-item span {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}



.p-3 {
    padding: 20px;
}

.contact-footer {
    background: var(--dark);
    color: #fff;
    padding: 80px 5%;
}

.social-icons {
    font-size: 2rem;
    margin-top: 20px;
}

.social-icons a {
    color: var(--primary);
    margin: 0 10px;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 50px 5%;
    }
}



/* Dhivehi Styling */
.dhivehi {
    font-family: "MV Boli", "Faruma", sans-serif;
    font-size: 1.2rem;
    margin-top: 10px;
    letter-spacing: 0;
}

.hero-subtitle.dhivehi {
    font-size: 1.8rem;
    color: var(--accent);
}

.election-info {
    margin-top: 25px;
}




/* Language Overlay Styles */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    text-align: center;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 50px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.overlay-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary);
}

.lang-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.lang-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    background: white;
    color: var(--secondary);
}

.lang-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.lang-btn.dhivehi {
    font-family: "MV Boli", sans-serif;
}





/* Gallery Grid - 3 Columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Exactly 3 cards */
    gap: 25px;
    margin-top: 40px;
}

.gallery-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.gallery-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.read-more-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: 600;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    right: 20px; top: 15px;
    font-size: 30px;
    cursor: pointer;
    color: var(--secondary);
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); } /* 2 cards for tablets */
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: 1fr; } /* 1 card for phones */
}






/* --- 1. CRITICAL MOBILE FIX (Add this at the top) --- */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* Stops horizontal scrolling */
    position: relative;
}

:root {
    --primary: #10b981;
    --secondary: #1e3a8a;
    --dark: #0f172a;
    --light: #f8fafc;
    --accent: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased; /* Smoother text on mobile */
}

/* --- 2. LAYOUT & CONTAINERS --- */
.container {
    padding: 80px 10%;
    width: 100%; /* Ensure container stays within bounds */
}

.text-center {
    text-align: center;
}

/* Nav Fix */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Center items vertically */
    padding: 15px 5%;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.logo {
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
    font-size: 1.3rem; /* Slightly smaller for mobile safety */
}

/* Hero Section Fix */
.hero {
    min-height: 100vh; /* Use min-height to prevent clipping content */
    width: 100%;
    background: linear-gradient(rgba(30, 58, 138, 0.7), rgba(16, 185, 129, 0.5)),
                url('images/shinaan-photo.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 20px; /* Add padding so text doesn't touch screen edges */
}

.hero h1 {
    font-size: clamp(2rem, 8vw, 4rem); /* Responsive font size */
    margin-bottom: 10px;
}

/* Timer Fix */
.timer {
    display: flex;
    justify-content: center;
    gap: 10px; /* Reduced gap for smaller screens */
    flex-wrap: wrap; /* Allows wrapping if screen is very small */
}

.timer-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    min-width: 70px; /* Consistent width */
}

/* Grid Adjustments */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

/* Commitments Grid Fix */
.commitments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Better sizing for mobile */
    gap: 20px;
    width: 100%;
}

/* Gallery Grid Fix */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* --- 3. OVERLAYS & MODALS (Mobile Stability) --- */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; 
    height: 100vh;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.overlay-content {
    max-width: 100%; /* Prevent overlay from going off-screen */
    padding: 30px 20px;
}

.lang-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Buttons stack if no room */
    justify-content: center;
}

/* --- 4. MEDIA QUERIES (The Clean Up) --- */
@media (max-width: 1024px) {
    .container { padding: 60px 5%; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 { font-size: 2.5rem; }
    .container { padding: 40px 5%; }
    
    /* Make sure images don't cause overflow */
    img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .timer-box { min-width: 60px; padding: 10px; }
    .timer-box span { font-size: 1.5rem; }
    .lang-btn { width: 100%; } /* Full width buttons for easy tapping */
}




#modal-img {
    width: 100%;
    max-height: 300px; /* Prevents the popup from being too tall */
    object-fit: cover; /* Keeps the aspect ratio clean */
    border-radius: 10px;
}

/* Ensure modal content is scrollable if the text is long */
.modal-content {
    max-height: 85vh; 
    overflow-y: auto;
}














