/*
 * APBS ortak tema
 * Kamu layout'u, yönetim layout'u, giriş ve hata sayfaları bu dosyayı kullanır.
 * Renk / köşe / gölge değerleri yalnızca buradaki token'lardan değiştirilmelidir.
 * Bootstrap 5.0.1'in üzerine yüklenir (Bootstrap CSS değişkenlerini desteklemediği
 * için bileşen renkleri aşağıda doğrudan eziliyor).
 */
:root {
    --apbs-primary: #0b5d8c;
    --apbs-primary-dark: #084566;
    --apbs-primary-soft: #e1eef6;
    --apbs-navy: #0f2f47;
    --apbs-bg: #f3f6f9;
    --apbs-surface: #ffffff;
    --apbs-border: #dde3ea;
    --apbs-text: #1a202c;
    --apbs-muted: #5f6b7a;
    --apbs-success: #1e7d4f;
    --apbs-success-soft: #e3f4ea;
    --apbs-warning: #8a5300;
    --apbs-warning-soft: #fff3dc;
    --apbs-danger: #b4232c;
    --apbs-danger-soft: #fdecee;
    --apbs-neutral-soft: #eceff3;
    --apbs-radius: .5rem;
    --apbs-radius-sm: .3rem;
    --apbs-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --apbs-shadow-lg: 0 10px 30px rgba(16, 24, 40, .10);
    --apbs-focus: 0 0 0 .2rem rgba(11, 93, 140, .28);
    --apbs-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Temel ---------- */
body {
    font-family: var(--apbs-font);
    color: var(--apbs-text);
    background-color: var(--apbs-bg);
}

a {
    color: var(--apbs-primary);
}

    a:hover {
        color: var(--apbs-primary-dark);
    }

:focus-visible {
    outline: 2px solid var(--apbs-primary);
    outline-offset: 2px;
}

/* ---------- Butonlar ---------- */
.btn-primary {
    background-color: var(--apbs-primary);
    border-color: var(--apbs-primary);
}

    .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
        background-color: var(--apbs-primary-dark);
        border-color: var(--apbs-primary-dark);
    }

.btn-outline-primary {
    color: var(--apbs-primary);
    border-color: var(--apbs-primary);
}

    .btn-outline-primary:hover, .btn-outline-primary:active, .btn-outline-primary.active {
        color: #fff;
        background-color: var(--apbs-primary);
        border-color: var(--apbs-primary);
    }

.btn:focus, .btn-check:focus + .btn {
    box-shadow: var(--apbs-focus);
}

/* ---------- Form ---------- */
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #5d9cc4;
    box-shadow: var(--apbs-focus);
}

.form-check-input:checked {
    background-color: var(--apbs-primary);
    border-color: var(--apbs-primary);
}

.form-label, .col-form-label {
    font-weight: 600;
}

/* ---------- Kart ve tablo ---------- */
.card {
    border: 1px solid var(--apbs-border);
    border-radius: var(--apbs-radius);
    box-shadow: var(--apbs-shadow);
}

.table > thead th {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--apbs-muted);
    white-space: nowrap;
    vertical-align: bottom;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(11, 93, 140, .04);
}

/* ---------- Sayfa başlığı (ApbsArayuz.SayfaBasligi) ---------- */
.apbs-sayfa-basligi {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
    margin: 1.5rem 0 1rem;
}

    .apbs-sayfa-basligi h1 {
        font-size: 1.375rem;
        font-weight: 600;
        margin: 0;
    }

    .apbs-sayfa-basligi p {
        margin: .25rem 0 0;
        color: var(--apbs-muted);
    }

/* ---------- Boş durum (ApbsArayuz.BosDurum) ---------- */
.apbs-bos-durum {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--apbs-muted);
}

    .apbs-bos-durum > i {
        display: block;
        font-size: 2rem;
        opacity: .45;
        margin-bottom: .75rem;
    }

    .apbs-bos-durum strong {
        display: block;
        color: var(--apbs-text);
        font-size: 1rem;
        margin-bottom: .25rem;
    }

/* ---------- Durum rozetleri (ApbsArayuz.IlanDurumu) ---------- */
.apbs-durum {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1;
    padding: .4em .65em;
    border-radius: 999px;
    white-space: nowrap;
}

.apbs-durum-acik { background: var(--apbs-success-soft); color: var(--apbs-success); }
.apbs-durum-yakinda { background: var(--apbs-primary-soft); color: var(--apbs-primary); }
.apbs-durum-az-kaldi { background: var(--apbs-warning-soft); color: var(--apbs-warning); }
.apbs-durum-kapali { background: var(--apbs-neutral-soft); color: var(--apbs-muted); }

/* ---------- Başvuru sihirbazı adım göstergesi (Views/Basvuru/_BasvuruStepper) ---------- */
.apbs-stepper .progress-bar {
    background-color: var(--apbs-primary);
}

.apbs-stepper-liste {
    display: flex;
    gap: .25rem;
    list-style: none;
    margin: 0;
    padding: 0 0 .25rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.apbs-adim {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
    font-size: .8125rem;
    padding: .3rem .6rem .3rem .3rem;
    border-radius: 999px;
    color: var(--apbs-muted);
    white-space: nowrap;
}

.apbs-adim-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 600;
    background: var(--apbs-neutral-soft);
}

.apbs-adim-tamam { color: var(--apbs-success); }
    .apbs-adim-tamam .apbs-adim-no { background: var(--apbs-success-soft); color: var(--apbs-success); }

.apbs-adim-aktif { background: var(--apbs-primary-soft); color: var(--apbs-primary); font-weight: 600; }
    .apbs-adim-aktif .apbs-adim-no { background: var(--apbs-primary); color: #fff; }

@media (max-width: 575.98px) {
    /* Telefonda yalnızca "Adım 3/9 · Eğitim" ve ilerleme çubuğu kalır */
    .apbs-stepper-liste { display: none; }
}

/* Başvuru detayı bölüm bağlantıları: sabit üst barın altında kalmasın */
[id^="bolum-"] {
    scroll-margin-top: 4.5rem;
}

/* ---------- Yönetim üst barı ---------- */
.apbs-topbar {
    background-color: var(--apbs-navy) !important;
}

    .apbs-topbar .navbar-brand {
        font-weight: 600;
        letter-spacing: .02em;
    }

    .apbs-topbar .apbs-kullanici-menu .btn {
        color: #fff;
        border-color: rgba(255, 255, 255, .25);
        max-width: 22rem;
    }

        .apbs-topbar .apbs-kullanici-menu .btn:hover,
        .apbs-topbar .apbs-kullanici-menu .btn:focus {
            background-color: rgba(255, 255, 255, .1);
        }

    .apbs-topbar .apbs-kullanici-adi {
        display: inline-block;
        max-width: 16rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

@media (max-width: 767.98px) {
    /* Mobilde sağdaki menü düğmesine (navbar-toggler) yer bırak */
    .apbs-topbar {
        flex-wrap: nowrap;
    }

        .apbs-topbar .apbs-kullanici-menu {
            margin-right: 5rem;
            min-width: 0;
        }

        .apbs-topbar .apbs-kullanici-adi {
            max-width: 7.5rem;
        }
}

.apbs-kullanici-menu .dropdown-menu {
    min-width: 16rem;
}

.apbs-kullanici-menu .dropdown-header {
    white-space: normal;
}

/* ---------- Giriş ve hata sayfaları ---------- */
.apbs-tek-sayfa {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.apbs-tek-kart {
    width: 100%;
    max-width: 30rem;
    background: var(--apbs-surface);
    border: 1px solid var(--apbs-border);
    border-radius: var(--apbs-radius);
    box-shadow: var(--apbs-shadow-lg);
    padding: 2rem;
}

    .apbs-tek-kart .apbs-logo {
        display: block;
        max-width: 8.5rem;
        margin: 0 auto 1rem;
    }

    .apbs-tek-kart h1 {
        font-size: 1.25rem;
        font-weight: 600;
        text-align: center;
        margin-bottom: .25rem;
    }

.apbs-alt-metin {
    color: var(--apbs-muted);
    font-size: .875rem;
}

.apbs-ayrac {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--apbs-muted);
    font-size: .8125rem;
    margin: 1.25rem 0;
}

    .apbs-ayrac::before, .apbs-ayrac::after {
        content: "";
        flex: 1;
        border-top: 1px solid var(--apbs-border);
    }

.btn-edevlet {
    background: #fff;
    color: #c8102e;
    border: 1px solid #c8102e;
    font-weight: 600;
}

    .btn-edevlet:hover, .btn-edevlet:focus {
        background: #c8102e;
        color: #fff;
    }

.apbs-hata-kodu {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .35em .75em;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.apbs-bilgi-kutusu {
    background: var(--apbs-bg);
    border: 1px solid var(--apbs-border);
    border-radius: var(--apbs-radius-sm);
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    word-break: break-word;
}

    .apbs-bilgi-kutusu .etiket {
        font-size: .7rem;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--apbs-muted);
        margin-bottom: .25rem;
    }

/* ---------- Bootstrap 3 uyumluluk (dönüştürülmemiş eski view'lar için) ---------- */
.form-group { margin-bottom: 1rem; }
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.btn-default { color: #495057; background-color: #fff; border-color: #ced4da; }
    .btn-default:hover { background-color: #f1f3f5; }
