/* styles.css */

/* General Body & Root Styles */
:root {
    --primary-color: #3b82f6; /* Blue */
    --secondary-color: #6ee7b7; /* Light Green for Early Applicant */
    --tag-bg-color: #e0f2fe; /* Light Blue */
    --light-gray: #f3f4f6;
    --medium-gray: #e5e7eb;
    --dark-gray: #4b5563;
    --text-color: #1f2937;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --icon-color: #6b7280;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

.main-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: var(--dark-gray);
    margin-bottom: 25px;
    text-align: center;
}

/* --- Utility Icons (Simple Characters for Demo) --- */
/* In a real project, use SVG or Font Awesome for better icons */
.icon-house::before { content: "🏠︎ "; }
.icon-rupee::before { content: "➤ "; }
.icon-briefcase::before { content: "👩🏻‍💻 "; }
.icon-sparkle::before { content: "✨ "; }
.icon-share::before { content: "🔗 "; }
.icon-users::before { content: "👥 "; }
.icon-actively-hiring::before { content: "⭐ "; } /* Custom icon for Actively Hiring */
.icon-calendar::before { content: "📅 "; } /* Custom icon for Start Date */
.icon-deadline::before { content: "⚙ "; } /* Custom icon for Apply By */


/* --- Job Listings Container (index.html) --- */
.job-listings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 40px;
    width: 100%;
}

.job-card-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Make the anchor tag fill the grid item */
}

.job-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards are same height in a row */
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Wrapper for job title and company icon */
.job-card-header-elements {
    display: flex;
    justify-content: space-between; /* Push company icon to the right */
    align-items: flex-start; /* Align icon to top, and title to top */
    margin-bottom: 5px; /* Reduced margin, as company info is next */
}

/* Wrapper for company name and actively hiring tag */
.company-info-row {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between company name and tag */
    flex-wrap: wrap; /* Allow wrapping if content is long */
    margin-bottom: 15px;
}

.tag-hiring {
    background-color: #d1fae5; /* Light green */
    color: #065f46; /* Dark green */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 600;
    display: flex; /* Ensure icon aligns with text */
    align-items: center;
    gap: 4px; /* Space between icon and text */
    white-space: nowrap; /* Prevent tag from breaking lines internally */
}

/* Styling for the actively hiring tag when it's inline with the title/company name */
.tag-hiring-inline {
    font-size: 0.75em; /* Slightly smaller to fit next to company name */
    padding: 4px 8px;
}

/* NEW: Styles for the default emoji icon on index.html job cards */
.company-icon-default {
    background-color: var(--tag-bg-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* NEW: Styles for the company logo image on index.html job cards */
.company-logo-img {
    width: 40px; /* Match the desired icon size */
    height: 40px;
    border-radius: 50%;
    object-fit: cover; /* Ensures image covers the area without distortion */
    flex-shrink: 0; /* Prevent image from shrinking */
    /* The parent .job-card-header-elements handles pushing it to the right */
}

.job-title {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
    color: black;
    line-height: 1.2;
}

.company-name {
    font-size: 0.95em;
    color: var(--dark-gray);
    margin: 0;
    line-height: 1.2;
}

.job-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--dark-gray);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto; /* Push tags to the bottom */
}

.tag-time {
    background-color: #b6b6b642; /* Light yellow */
    color: #53e60f; /* Dark yellow */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: 500;
}

.tag-early-applicant {
    background-color: var(--secondary-color);
    color: #065f46;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-type {
    background-color: var(--tag-bg-color);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: 500;
}


/* --- Job Detail Page (job-detail.html) --- */
.job-detail-container {
    width: 100%;
    max-width: 800px; /* Max width for detail card */
}

.job-detail-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    position: relative;
}

/* Container for the company icon/logo on the detail page */
.company-icon-detail {
    position: absolute; /* Position relative to .job-detail-card */
    top: 30px;
    right: 30px;
    background-color: var(--tag-bg-color);
    color: var(--primary-color); /* Applied to emoji fallback */
    width: 50px; /* Slightly larger icon */
    height: 50px;
    border-radius: 50%;
    display: flex; /* To center the image/emoji inside */
    align-items: center;
    justify-content: center;
    font-size: 1.5em; /* For emoji fallback */
    font-weight: bold; /* For emoji fallback */
    overflow: hidden; /* Ensures circular crop if image is larger than container */
}

/* NEW: Styles for the company logo image on job-detail.html */
.company-logo-img-detail {
    width: 100%; /* Make image fill its parent (.company-icon-detail) */
    height: 100%;
    border-radius: 50%; /* Ensure it's circular */
    object-fit: cover; /* Crop to fit, maintain aspect ratio */
}

.job-detail-title {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-align: left;
    color: black;
    line-height: 1.2;
    margin-top: 0;
    max-width: calc(100% - 90px); /* Leave space for absolute icon + gap */
}

/* Wrapper for company name and actively hiring tag on detail page */
.company-info-row-detail {
    display: flex;
    align-items: center;
    gap: 15px; /* More space for detail page */
    margin-bottom: 10px;
    flex-wrap: wrap;
    max-width: calc(100% - 90px); /* Leave space for absolute icon + gap */
}

.job-detail-company {
    font-size: 1.1em;
    color: var(--dark-gray);
    margin: 0;
    line-height: 1.2;
}

.job-detail-work-mode {
    font-size: 1em;
    color: var(--dark-gray);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 90px); /* Leave space for absolute icon + gap */
}

.job-key-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    border-top: 1px solid var(--medium-gray);
    border-bottom: 1px solid var(--medium-gray);
    padding: 20px 0;
}

.key-info-item {
    display: flex;
    flex-direction: column;
}

.key-info-label {
    font-size: 0.85em;
    color: var(--dark-gray);
    margin-bottom: 5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.key-info-value {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-posted-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.job-applicants {
    font-size: 0.95em;
    color: var(--dark-gray);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-actions {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 15px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

.share-button {
    background-color: var(--light-gray);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.share-button:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.apply-button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.apply-button:hover {
    background-color: #2563eb; /* Darker primary */
}

.about-job h2 {
    font-size: 1.5em;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 15px;
}

.about-job p {
    font-size: 1em;
    color: var(--dark-gray);
    line-height: 1.7;
}

/* --- Placeholder for Loading State --- */
.loading-placeholder {
    text-align: center;
    padding: 50px;
    color: var(--dark-gray);
    font-size: 1.1em;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
        margin: 10px auto;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    /* Job Card Adjustments */
    .job-listings-container {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .job-card {
        padding: 15px;
    }

    .job-card-header-elements {
        margin-bottom: 5px;
    }

    .company-info-row {
        gap: 8px;
        margin-bottom: 10px;
    }

    .job-title {
        font-size: 1.2em;
    }

    .job-details-row, .job-tags {
        font-size: 0.85em;
        gap: 6px;
    }

    .tag-hiring, .tag-time, .tag-early-applicant, .tag-type {
        padding: 4px 8px;
        font-size: 0.75em;
    }

    /* NEW: Adjustments for company icons/logos on job cards (index.html) */
    .company-icon-default, .company-logo-img {
        width: 35px; /* Slightly smaller for mobile */
        height: 35px;
        font-size: 1em; /* Adjust emoji size */
    }

    /* Job Detail Page Adjustments */
    .job-detail-card {
        padding: 20px;
    }

    /* NEW: Adjustments for company icon/logo container on detail page */
    .company-icon-detail {
        width: 45px;
        height: 45px;
        font-size: 1.3em; /* Adjust emoji size */
        top: 20px;
        right: 20px;
    }

    .job-detail-title {
        font-size: 1.5em;
        max-width: calc(100% - 70px); /* Adjusted for mobile icon size */
    }

    .company-info-row-detail {
        margin-top: 0;
        gap: 10px;
        max-width: calc(100% - 70px); /* Adjusted for mobile icon size */
    }
    
    .job-detail-work-mode {
        max-width: calc(100% - 70px); /* Adjusted for mobile icon size */
    }

    .job-key-info {
        grid-template-columns: 1fr; /* Single column for key info on mobile */
        padding: 15px 0;
        gap: 15px;
    }

    .key-info-label {
        font-size: 0.8em;
        gap: 4px;
    }

    .key-info-value {
        font-size: 1em;
    }

    .job-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 15px;
    }

    .share-button, .apply-button {
        padding: 10px 15px;
        text-align: center;
        justify-content: center;
    }

    .about-job h2 {
        font-size: 1.3em;
    }
}
