* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #93c5fd;
    --secondary: #10b981;
    --background: #f9fafb;
    --surface: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --remote: #10b981;

    /* Spacing System (8px grid) */
    --space-1: 0.5rem;   /* 8px */
    --space-2: 1rem;     /* 16px */
    --space-3: 1.5rem;   /* 24px */
    --space-4: 2rem;     /* 32px */
    --space-6: 3rem;     /* 48px */
    --space-8: 4rem;     /* 64px */

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

    /* Source colors */
    --fortehub: #3b82f6;
    --apeople: #10b981;
    --witted: #8b5cf6;
    --verama: #f59e0b;
    --kons: #ec4899;
    --experis: #06b6d4;

    /* Deadline warning colors */
    --deadline-expired: #ef4444;
    --deadline-urgent: #f97316;
    --deadline-soon: #eab308;
    --deadline-ok: #10b981;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) 0;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-1);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 400;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.stat-card {
    background: linear-gradient(135deg, var(--surface) 0%, #fafbfc 100%);
    padding: var(--space-3);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-1);
    animation: fadeIn 0.5s ease-out;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Search */
.search-bar {
    margin-bottom: var(--space-2);
}

#searchInput {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow);
    transform: translateY(-1px);
}

#searchInput::placeholder {
    color: var(--text-light);
}

/* Filters */
.filters {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 0.75rem var(--space-3);
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-md);
}

.filter-select {
    padding: 0.75rem var(--space-3);
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.filter-select:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow);
}

.clear-btn {
    padding: 0.75rem var(--space-3);
    border: 2px solid var(--text-light);
    background: var(--surface);
    color: var(--text-light);
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.clear-btn:hover {
    border-color: var(--text);
    color: var(--text);
    background: var(--background);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Job Grid */
.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.job-card {
    background: var(--surface);
    border-radius: 0.75rem;
    padding: var(--space-3);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(37, 99, 235, 0.03) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.job-card:hover::before {
    opacity: 1;
}

.job-header {
    margin-bottom: var(--space-2);
}

.job-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-1);
    line-height: 1.3;
}

.job-title a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.job-title a:hover {
    color: var(--primary);
}

.job-company {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.job-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: var(--space-2);
}

.job-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.job-published {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: var(--space-2);
    font-weight: 500;
}

.job-details {
    background: linear-gradient(135deg, var(--background) 0%, #f3f4f6 100%);
    padding: var(--space-2);
    border-radius: 0.5rem;
    margin-bottom: var(--space-2);
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--text);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.job-details strong {
    color: var(--text);
    font-weight: 700;
    margin-right: 0.375rem;
}

.remote-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    padding: 0.375rem var(--space-2);
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.job-description {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.tag {
    background: var(--background);
    color: var(--text);
    padding: 0.375rem var(--space-2);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.tag:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--shadow);
}

.tag:active {
    transform: translateY(0) scale(1);
}

.job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-2);
    border-top: 2px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: auto;
}

.job-source {
    font-weight: 700;
    padding: 0.375rem var(--space-2);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.job-source:hover {
    transform: scale(1.05);
}

.job-source img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.job-source.source-fortehub {
    background: rgba(59, 130, 246, 0.1);
    color: var(--fortehub);
}

.job-source.source-apeople {
    background: rgba(16, 185, 129, 0.1);
    color: var(--apeople);
}

.job-source.source-witted {
    background: rgba(139, 92, 246, 0.1);
    color: var(--witted);
}

.job-source.source-verama {
    background: rgba(245, 158, 11, 0.1);
    color: var(--verama);
}

.job-source.source-kons {
    background: rgba(236, 72, 153, 0.1);
    color: var(--kons);
}

.job-source.source-experis {
    background: rgba(6, 182, 212, 0.1);
    color: var(--experis);
}

.job-date {
    font-size: 0.8125rem;
    font-weight: 500;
}

.deadline-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: var(--space-1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

.deadline-expired {
    background: var(--deadline-expired);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.deadline-urgent {
    background: var(--deadline-urgent);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

.deadline-soon {
    background: var(--deadline-soon);
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.3);
}

.deadline-ok {
    background: var(--deadline-ok);
    animation: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-light);
    background: var(--surface);
    border-radius: 0.75rem;
    border: 2px dashed var(--border);
    animation: fadeIn 0.4s ease-out;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-1);
    color: var(--text);
    font-weight: 700;
}

.empty-state p {
    font-size: 1rem;
    color: var(--text-light);
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 2px solid var(--border);
    padding: var(--space-4) 0;
    margin-top: var(--space-8);
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

footer p {
    margin: var(--space-1) 0;
    font-weight: 500;
}

/* Active Filter Chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    background: var(--background);
    border-radius: 0.75rem;
    border: 2px solid var(--border);
    animation: slideIn 0.3s ease-out;
}

.active-filters.hidden {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.5rem var(--space-2);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-out;
}

.filter-chip button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: background var(--transition-fast);
    font-size: 1rem;
    line-height: 1;
}

.filter-chip button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Result Counter */
.result-counter {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--background);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    border: 2px solid var(--border);
    margin-left: auto;
}

.result-counter .count {
    color: var(--primary);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .job-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-btn,
    .filter-select,
    .clear-btn {
        width: 100%;
    }

    .result-counter {
        width: 100%;
        justify-content: center;
    }
}
