/* משתני CSS מעודכנים */
:root {
    --primary-color: #2557a7;
    --primary-light: #3267b7;
    --primary-dark: #1d4589;
    --secondary-color: #00a3bf;
    --accent-color: #ff6b6b;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-light: #8392a5;
    --background-light: #f8f9fa;
    --background-white: #fff;
    --border-color: #e0e0e0;
    --input-focus-color: rgba(37, 87, 167, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius-sm: 6px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --header-height: 72px;
    --transition: all 0.3s ease;
    --max-width: 1280px;
}

/* עיצוב בסיסי */
body {
    font-family: 'Heebo', sans-serif;
    line-height: 1.6;
    background-color: var(--background-light);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-top: var(--header-height);
    direction: rtl;
}

/* כותרת ראשית */
h1 {
    font-size: 2.8rem;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    text-align: center;
    font-weight: 700;
    position: relative;
}

h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin: 1rem auto;
    border-radius: 2px;
}

/* עיצוב תיבת החיפוש והפילטרים */
.job-filters {
    background: var(--background-white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

/* עיצוב שדות הקלט */
.job-filters input,
.job-filters select {
    width: 100%;
    padding: 1rem 2.5rem 1rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Heebo', sans-serif;
    background-color: white;
    appearance: none;
    position: relative;
}

/* הוספת אייקונים לשדות */
#search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238392a5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 20px;
    padding-left: 2.5rem;
}

#location {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238392a5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 11a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 20px;
    padding-left: 2.5rem;
}

#category, #job-type {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238392a5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 20px;
    padding-left: 2.5rem;
}

#min-salary, #max-salary {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238392a5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 20px;
    padding-left: 2.5rem;
}

/* מצבי hover ו-focus */
.job-filters input:hover,
.job-filters select:hover {
    border-color: var(--primary-light);
}

.job-filters input:focus,
.job-filters select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px var(--input-focus-color);
}

/* רשימת המשרות */
.job-list {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

/* כפתור חזרה למעלה */
#back-to-top {
    position: fixed;
    bottom: 2.5rem;
    left: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* מצב טעינה */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* התאמה למובייל */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    #jobs-page {
        padding: 0 1rem;
    }

    .job-filters {
        padding: 1.5rem;
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.2rem;
    }

    .job-list {
        grid-template-columns: 1fr;
    }

    #back-to-top {
        bottom: 1.5rem;
        left: 1.5rem;
        width: 40px;
        height: 40px;
    }
}

/* מצב חושך */
@media (prefers-color-scheme: dark) {
    :root {
        --background-light: #1a1a1a;
        --background-white: #242424;
        --text-primary: #e1e1e1;
        --text-secondary: #b0b0b0;
        --border-color: #333;
    }

    .job-filters input,
    .job-filters select {
        background-color: #1a1a1a;
        color: var(--text-primary);
    }

    .job-filters input::placeholder {
        color: #666;
    }

    #back-to-top {
        background: var(--primary-light);
    }

    #back-to-top:hover {
        background: var(--primary-color);
    }
}

/* נגישות */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* טיפול בפוקוס */
:focus-visible {
    outline: 3px solid var(--input-focus-color);
    outline-offset: 2px;
}