/* Reset & base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    visibility: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Content */
.main-content {
    flex: 1;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    padding: clamp(2rem, 5vw, 4rem) 1rem;
    text-align: center;
    color: var(--text-color-light);
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Search Container */
.search-container {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    overflow: hidden;
}

#searchInput {
    width: 100%;
    border: none;
    padding: clamp(0.8rem, 2vw, 1rem) 1.5rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
    outline: none;
}

#searchButton {
    background-color: var(--dark-color);
    color: var(--text-color-light);
    border: none;
    padding: 0 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: clamp(1rem, 2vw, 1.2rem);
}

#searchButton:hover {
    background-color: #333;
}


/* Filter Section */
.filter-section {
    background-color: #f8f9fa;
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.category-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    user-select: none;
    font-weight: 600;
}

.category-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border-color: var(--primary-color);
}


/* ========== JOB LIST SECTION ========== */
.job-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(1.2rem, 2vw, 1.8rem);
    padding: 0 clamp(0.5rem, 1.5vw, 0.8rem);
    max-width: 1200px;
    margin: 0 auto clamp(2rem, 3vw, 4rem);
    user-select: none;
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
}

/* Job Card */
.job-card {
    background: var(--card-background-color);
    border-radius: 16px;
    padding: clamp(15px, 2vw, 20px);
    color: #d4f8e8;
    box-shadow: 0 8px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.job-card:hover,
.job-card:hover h3,
.job-card:hover p,
.job-card:hover a {
    color: var(--text-color-light);
}

.job-card:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
}

.job-card h3 {
    margin-bottom: 0.6rem;
    font-size: clamp(1.1rem, 2vw, 1.2rem);
    font-weight: 700;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card p {
    font-size: clamp(0.8rem, 1.5vw, 0.85rem);
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.3;
}

.job-card a {
    color: inherit;
    text-decoration: none;
    display: block;
}

/* Meta Row in Job Card */
.job-meta-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
    color: #7f8c8d;
}

.loading-spinner {
    margin: 2rem auto;
    width: 50px;
    height: 50px;
    border: 6px solid #ddd;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVENESS ========== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: clamp(1.8rem, 5vw, 2.2rem);
    }

    .search-container {
        border-radius: 30px;
    }

    #searchInput {
        padding: clamp(0.7rem, 2vw, 0.9rem) 1rem;
    }

    #searchButton {
        padding: 0 1.2rem;
    }

    .job-list {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .filter-section {
        padding: 1rem 0.5rem;
    }

    .category-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .job-list {
        padding: 0 1rem;
        grid-template-columns: 1fr;
    }
}
