/* ==========================================================================
   1. CSS Reset ve Temel Ayarlar
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   2. Renk ve Tema Değişkenleri
   ========================================================================== */
:root {
    --primary-orange: #F97316;
    --primary-orange-dark: #EA580C;
    --primary-orange-light: #FFF7ED;
    --bg-color: #F9FAFB;
    --card-bg-color: #FFFFFF;
    --text-color: #1F2937;
    --text-light-color: #4B5563;
    --text-extra-light-color: #6B7280;
    --border-color: #E5E7EB;
    --border-medium-color: #D1D5DB;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --focus-ring-color: rgba(249, 115, 22, 0.3);
    --danger-color: #DC2626;
    --danger-color-hover: #B91C1C;
    --success-color: #16A34A;
    --success-bg-color: rgba(22, 163, 74, 0.1);
    --footer-bg-color: #1F2937;
    --footer-text-color: #D1D5DB;
    --footer-link-color: #FFFFFF;
}

[data-theme='dark'] {
    --bg-color: #111827;
    --card-bg-color: #1F2937;
    --text-color: #F9FAFB;
    --text-light-color: #9CA3AF;
    --text-extra-light-color: #6B7280;
    --border-color: #374151;
    --border-medium-color: #4B5563;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --footer-bg-color: #111827;
    --footer-text-color: #6B7280;
    --footer-link-color: #9CA3AF;
}

/* ==========================================================================
   3. Genel Bileşenler (Header, Footer, Butonlar)
   ========================================================================== */
.site-header, .site-footer {
    background-color: var(--card-bg-color);
    padding: 1rem 1.5rem;
    transition: background-color 0.3s, color 0.3s;
}
.site-header {
    box-shadow: 0 1px 3px 0 var(--shadow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}
.logo-text { font-size: 1.25rem; font-weight: 600; }
.logo-icon { color: var(--primary-orange); font-size: 2rem; font-weight: 700; margin-right: 0.5rem; }
[dir="rtl"] .logo-icon { margin-right: 0; margin-left: 0.5rem; }

.main-nav { display: none; align-items: center; gap: 1rem; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    text-align: center;
}
.btn-login { background-color: var(--primary-orange); color: white; }
.btn-register { background-color: transparent; border-color: var(--primary-orange); color: var(--primary-orange); }
.btn-secondary { background-color: transparent; border-color: var(--border-medium-color); color: var(--text-light-color); }
.btn-danger { background-color: var(--danger-color); color: white; }

.btn-login:hover { background-color: var(--primary-orange-dark); }
.btn-register:hover { background-color: var(--primary-orange-light); }
[data-theme='dark'] .btn-register:hover { background-color: rgba(249, 115, 22, 0.1); }
.btn-secondary:hover { background-color: var(--bg-color); border-color: var(--text-light-color); }
.btn-danger:hover { background-color: var(--danger-color-hover); }

/* ==========================================================================
   4. Dil Seçim Menüsü (Modernize Edilmiş)
   ========================================================================== */
.language-select-wrapper {
    position: relative;
    display: inline-block;
}
.language-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-medium-color);
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    line-height: 1.2;
}
[dir="rtl"] .language-select {
    padding-left: 1rem;
    padding-right: 2.5rem;
}
.language-select:hover {
    border-color: var(--primary-orange);
}
.language-select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px var(--focus-ring-color);
}
.language-select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.8rem;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    background-color: var(--text-light-color);
    -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3e%3cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3e%3c/svg%3e");
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3e%3cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    transition: background-color 0.3s;
}
[dir="rtl"] .language-select-wrapper::after {
    right: auto;
    left: 0.8rem;
}


/* ==========================================================================
   5. Mobil Menü ve Tema Butonu
   ========================================================================== */
.mobile-menu-button, .theme-toggle-btn, .close-mobile-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.mobile-menu-button svg, .close-mobile-menu svg { width: 1.5rem; height: 1.5rem; stroke: var(--text-light-color); }
.theme-toggle-btn { border-radius: 0.5rem; color: var(--text-light-color); transition: color 0.3s, background-color 0.3s; }
.theme-toggle-btn:hover { color: var(--text-color); background-color: var(--bg-color); }
.theme-toggle-btn svg { width: 1.25rem; height: 1.25rem; }
#theme-toggle-light-icon { display: none; }
#theme-toggle-dark-icon { display: block; }
[data-theme='dark'] #theme-toggle-light-icon { display: block; }
[data-theme='dark'] #theme-toggle-dark-icon { display: none; }

.mobile-menu-overlay { position: fixed; inset: 0; background-color: var(--card-bg-color); z-index: 50; transform: translateX(-100%); transition: transform 0.3s ease-in-out, background-color 0.3s; box-shadow: 0 10px 15px -3px var(--shadow-color); }
[dir="rtl"] .mobile-menu-overlay { transform: translateX(100%); }
.mobile-menu-content { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu-content .btn, .mobile-menu-content .language-select-wrapper { width: 100%; }
.mobile-menu-content .language-select { width: 100%; text-align: left; }
[dir="rtl"] .mobile-menu-content .language-select { text-align: right; }

/* ==========================================================================
   6. Ana İçerik ve Kart Yapıları
   ========================================================================== */
.main-content { flex-grow: 1; max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; width: 100%; }
.hero-section, .job-card, .form-container, .choice-card, .profile-card, .profile-content, .job-detail-section {
    background-color: var(--card-bg-color);
    box-shadow: 0 4px 6px -1px var(--shadow-color);
    border-radius: 0.75rem;
    transition: background-color 0.3s, box-shadow 0.3s;
}
.hero-section { text-align: center; margin-bottom: 3rem; padding: 2rem; }
.hero-section h1 { margin-bottom: 1.5rem; }
.featured-jobs-section h2 { margin-bottom: 1.5rem; text-align: center; }

/* ==========================================================================
   7. Formlar ve Arama Kutusu
   ========================================================================== */
.search-container { display: flex; max-width: 600px; margin: 0 auto; border: 1px solid var(--border-medium-color); border-radius: 0.5rem; box-shadow: 0 1px 3px 0 var(--shadow-color); overflow: hidden; transition: all 0.3s ease; }
.search-container:focus-within { border-color: var(--primary-orange); box-shadow: 0 0 0 3px var(--focus-ring-color); }
.search-container input { flex-grow: 1; border: none; padding: 0.85rem 1.5rem; outline: none; background-color: transparent; color: var(--text-color); min-width: 100px; }
.search-container .btn-search { border: none; border-radius: 0; border-left: 1px solid var(--border-medium-color); background-color: var(--primary-orange); color: white; }
[dir="rtl"] .search-container .btn-search { border-left: none; border-right: 1px solid var(--border-medium-color); }

.login-section, .post-job-section { display: flex; justify-content: center; align-items: flex-start; padding: 2rem 0; }
.form-container { padding: 2.5rem; width: 100%; max-width: 700px; }
.form-container h1 { text-align: center; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; text-align: left; }
[dir="rtl"] .form-group label { text-align: right; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-medium-color);
    border-radius: 0.5rem;
    transition: all 0.3s;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary-orange); box-shadow: 0 0 0 3px var(--focus-ring-color); }
.form-footer { text-align: center; margin-top: 2rem; color: var(--text-light-color); }
.form-row { display: grid; gap: 1rem; }
.location-row-compact, .salary-row { grid-template-columns: 1fr; }

/* ==========================================================================
   8. İş İlanı Kartları (Ana Sayfa)
   ========================================================================== */
.job-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.job-card { 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem; 
    border: 1px solid var(--border-color); 
}
.job-card:hover { box-shadow: 0 10px 15px -3px var(--shadow-color); }
.job-card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem;}
.job-card p { color: var(--text-light-color); font-size: 0.875rem; margin-bottom: 0.75rem;}
.job-meta { display: flex; flex-direction: column; gap: 0.5rem; color: var(--text-extra-light-color); font-size: 0.875rem; margin-bottom: 1rem;}
.job-meta span { display: flex; align-items: center; }
.job-meta svg { width: 1rem; height: 1rem; margin-right: 0.25rem; }
[dir="rtl"] .job-meta svg { margin-right: 0; margin-left: 0.5rem; }
.job-salary { font-size: 1.125rem; font-weight: 700; color: var(--primary-orange); margin-bottom: 1rem; }
.job-card-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-color); text-align: right; }
.job-detail-link { color: var(--primary-orange); font-weight: 600; transition: color 0.3s; }
.job-detail-link:hover { color: var(--primary-orange-dark); }

/* ==========================================================================
   9. İlan Detay Sayfası
   ========================================================================== */
.job-detail-section { padding: 2rem; }
.job-detail-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.job-detail-header .company-name { font-size: 1.1rem; color: var(--text-light-color); margin-bottom: 1rem; }
.job-meta-detail { display: flex; gap: 1.5rem; color: var(--text-extra-light-color); margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.job-salary-detail { font-size: 1.2rem; font-weight: 700; color: var(--primary-orange); margin-bottom: 2rem; }
.job-detail-description h2 { margin-bottom: 1rem; }
.job-detail-description p { line-height: 1.7; color: var(--text-light-color); }
.job-detail-apply { margin-top: 2rem; text-align: center; }

/* ==========================================================================
   10. Profil Sayfası Özel Stilleri
   ========================================================================== */
.profile-container { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: flex-start; }
.profile-card { padding: 2rem; text-align: center; }
.profile-picture-container { position: relative; width: 150px; height: 150px; margin: 0 auto 1.5rem; }
.profile-picture { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--card-bg-color); box-shadow: 0 0 10px var(--shadow-color); }
.profile-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.profile-email { font-size: 0.875rem; color: var(--text-light-color); margin-bottom: 1.5rem; }
.profile-stats { display: flex; justify-content: space-around; border-top: 1px solid var(--border-color); padding-top: 1rem; }
.stat-value { font-size: 1.25rem; font-weight: 700; }
.stat-label { font-size: 0.75rem; color: var(--text-light-color); }
.profile-content { overflow: hidden; }
.profile-tabs { display: flex; border-bottom: 1px solid var(--border-color); }
.tab-link { flex-grow: 1; padding: 1rem 0.5rem; cursor: pointer; border: none; background: none; color: var(--text-light-color); border-bottom: 3px solid transparent; transition: all 0.3s ease; font-weight: 600; }
.tab-link:hover { background-color: var(--bg-color); }
.tab-link.active { color: var(--primary-orange); border-bottom-color: var(--primary-orange); }
.tab-pane { display: none; padding: 2rem; }
.tab-pane.active { display: block; }
.tab-pane h3, .profile-form h4 { margin-top: 0; margin-bottom: 1.5rem; }
.form-divider { border: 0; height: 1px; background-color: var(--border-color); margin: 2.5rem 0; }
.job-card-profile { padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 0.5rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.job-card-info { flex-grow: 1; }
.job-card-profile h4 { margin: 0 0 0.5rem 0; }
.job-card-profile p { margin: 0; color: var(--text-light-color); font-size: 0.875rem; }
.job-actions { display: flex; gap: 0.5rem; margin-left: 1rem; }
.job-card-confirm-delete { width: 100%; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color); display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }
.job-card-confirm-delete p { margin: 0; margin-right: auto; font-size: 0.9rem; font-weight: 500; }

/* ==========================================================================
   11. Medya Sorguları (Responsive)
   ========================================================================== */
@media (min-width: 768px) {
    .main-nav { display: flex; }
    .mobile-menu-button { display: none; }
    .mobile-menu-overlay { display: none; }
    .job-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { flex-direction: row; justify-content: space-between; }
    .choice-container { flex-direction: row; }
    .location-row-compact { grid-template-columns: 1fr 1fr 1fr; }
    .salary-row { grid-template-columns: 2fr 1fr; }
    .profile-container { grid-template-columns: 280px 1fr; }
}

@media (min-width: 1024px) {
    .main-content { padding: 2rem 3rem; }
    .hero-section { padding: 4rem; }
    .job-grid { grid-template-columns: repeat(3, 1fr); }
}
