/* ===========================
   1. General Setup
   =========================== */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

/* ===========================
   2. Navbar (Top Fixed with Color)
   =========================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background:#1e3d59; color:#fff;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1100;
    height: 70px;
    box-sizing: border-box;
}

.welcome-text {
    font-weight: bold;
    font-size: 18px;
    color: #ffffff;
}

.menu-toggle {
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    color: #ffffff;
}

/* ===========================
   Sidebar Menu
   =========================== */
/* ===========================
   Sidebar - Desktop
   =========================== */
.nav-links {
    position: fixed;
    top: 70px;
    right: -200px;       /* Fully hidden */
    width: 180px;        /* Sidebar width */
    height: calc(100vh - 55px);
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1200;
    list-style: none;
}

.nav-links.open {
    right: 0;            /* Fully visible when open */
}

/* ===========================
   Sidebar - Mobile
   =========================== */
@media (max-width: 768px) {
    .nav-links {
        width: 140px;        /* Reduce width for mobile */
        right: -140px;       /* Hidden position for mobile */
        padding: 15px 8px;
    }

    .nav-links.open {
        right: 0;            /* Fully visible when open */
    }

    .nav-links li a {
        padding: 6px 8px;    /* Fit smaller sidebar */
        font-size: 16px;
    }
}



.nav-links li a {
    display: inline-block;     /* Wrap background only around text */
    padding: 8px 12px;         /* Adjust padding around text */
    text-decoration: none;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s ease;
}

/* Hover effect */
.nav-links li a:hover {
    background: rgba(0, 123, 255, 0.2);  /* Highlight behind text only */
}


/* ===========================
   3. Search Bar
   =========================== */
.search-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 500px;
    margin: 0 15px;
    display: flex;
    align-items: center;
}

#searchInput {
    width: 100%;
    height: 38px;
    padding: 8px 85px 8px 15px;
    border-radius: 20px;
    border: none;
    background: #ffffff;
    outline: none;
    font-size: 15px;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.search-icons {
    position: absolute;
    right: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-icons span, .search-icons label {
    cursor: pointer;
    color: #555;
}

/* ===========================
   4. Results Grid
   =========================== */
#results {
    display: grid;
    gap: 20px;
    padding: 100px 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Card Styling */
.job {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.img-wrapper {
    width: 100%;
    height: auto;          /* Let height adjust based on image aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
}

.img-wrapper img {
    width: 100%;           /* Fill the container width */
    height: auto;          /* Maintain aspect ratio */
    object-fit: contain;   /* Show entire image without cropping */
    border-radius: 8px;
}


.button-row {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.button-row button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
}

.button-row button:first-child {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.button-row button:last-child {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

/* ===========================
   5. MOBILE ONLY
   =========================== */
@media (max-width: 768px) {
    .navbar {
        height: auto;
        padding: 10px 15px;
        flex-wrap: wrap;
    }

    .welcome-text {
        width: 100%;
        margin-bottom: 8px;
        order: 1;
        text-align: left;
    }

    .search-wrapper {
        order: 2;
        width: 70%;
        margin: 0;
    }

    .menu-toggle {
        order: 3;
        margin-left: 5px;
    }

    #results {
        padding-top: 20px;
        grid-template-columns: 1fr;
    }
}

/* Overlay */
/* Sidebar above overlay */
.nav-links {
    display: flex;
    flex-direction: column;
    align-items: right;       /* Center text buttons */
}


/* Overlay behind sidebar */
#menuOverlay {
    z-index: 1150;
    display: none;
}




/* Sidebar links spacing */
.nav-links li {
    margin: 10px 0;        /* Uniform top/bottom spacing */
    list-style: none;       /* Remove bullets if any */
}

/* Sidebar link styling */
.nav-links li a {
    display: block;        /* Make entire row clickable */
    padding: 10px 15px;    /* Consistent padding inside link */
    text-decoration: none;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    border-radius: 8px;     /* Optional: rounded link background */
    transition: background 0.2s ease;
}

/* Optional: Hover effect */
.nav-links li a:hover {
    background: rgba(0, 123, 255, 0.1); /* Light highlight on hover */
}

/* Profile dropdown menu spacing */
.profile-dropdown .profile-menu li {
    margin: 8px 0;          /* Uniform spacing between dropdown items */
}

.profile-dropdown .profile-menu li a {
    padding-left: 20px;     /* Indent dropdown items */
    font-size: 16px;
}




/* Profile dropdown menu - hidden by default */
.profile-dropdown {
    position: relative;  /* Needed for absolute positioning */
}

.profile-dropdown .profile-menu {
    display: none;       /* Hide by default */
    position: absolute;  /* Position relative to profile button */
    top: 100%;           /* Below button */
    left: 0;
    background: #fff;    /* White background */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 150px;
    z-index: 1300;
}

/* Show dropdown when parent has 'open' */
.profile-dropdown.open .profile-menu {
    display: block;
}

.profile-dropdown .profile-menu li a {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.profile-dropdown .profile-menu li a:hover {
    background: #007bff;
    color: #fff;
}