/*
   NOHU ortak arayüz bileşenleri — Web Uygulamaları Arayüz Tasarım Talimatı (Geliştirici
   Uygulama Rehberi 1.1, 13.11.2026). Kaynak: docs/WEb_ARAYUZ_STANDART_V2/GELISTIRICI_REHBERI.md

   BU DOSYA KARİYER, BAŞVURU, TAKİP VE ENVANTER'DE AYNIDIR. Bir uygulamada değiştirilirse
   diğerlerine de aynen kopyalanır; uygulamaya özgü görünüm uygulamanın kendi CSS'inde kalır.

   Renkler Bootstrap 5.3 değişkenlerinden okunur; açık/koyu tema geçişinde bileşenler
   kendiliğinden uyar. Bootstrap 5.3 olmayan uygulama (ENVANTER) yedek değerlere düşer.

   Kapsam: üst alan simgeleri (dil, NOHULOGIN, kullanıcı), açıklama balonu, tema seçimi,
   footer ve ilk yükleme ekranı. Betiği: js/nohu-arayuz.js.
*/

:root {
    --nohu-turkuaz: #008A9A;
    --nohu-metin: var(--bs-body-color, #252f4a);
    --nohu-soluk: var(--bs-secondary-color, #78829d);
    --nohu-yuzey: var(--bs-body-bg, #ffffff);
    --nohu-cizgi: var(--bs-border-color, #e4e6ef);
    --nohu-vurgu-zemin: var(--bs-tertiary-bg, #f5f8fa);
    --nohu-odak: var(--nohu-turkuaz);
}

/* ---------------------------------------------------------------
   Üst alan simge düğmesi — dil, NOHULOGIN, bildirim.
   Tıklama alanı en az 44 × 44, simge 20–24 px (Rehber §4). Renk zeminden gelir:
   currentColor sayesinde açık/koyu üst alanda kendiliğinden döner; favicon rengi
   üst alan simgelerine uygulanmaz (Rehber §3).
   --------------------------------------------------------------- */
.nohu-ikon-dugme {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 .5rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.nohu-ikon-dugme:hover { background: var(--nohu-vurgu-zemin); color: inherit; }

.nohu-ikon-dugme svg { width: 22px; height: 22px; display: block; flex-shrink: 0; }

/* Bayrak yatay dikdörtgendir; yüksekliği 16 px tutulur ki diğer simgelerle aynı boyda dursun. */
.nohu-ikon-dugme .nohu-bayrak,
.nohu-bayrak { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }

/* Odak her zaman görünür (Rehber §9). */
.nohu-ikon-dugme:focus-visible,
.nohu-kullanici:focus-visible,
.nohu-surum:focus-visible,
.nohu-tema-secim input:focus-visible + label {
    outline: 2px solid var(--nohu-odak);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Açıklama balonu. title niteliğine dayanılmaz: fareyle üzerine gelmede ve klavye
   odağında görünür, Escape ile kapanır (Rehber §3, §9). Balonu nohu-arayuz.js çizer.
   --------------------------------------------------------------- */
.nohu-ipucu {
    position: fixed;
    z-index: 2000;
    max-width: 260px;
    padding: .35rem .6rem;
    border-radius: .375rem;
    background: #1e2129;
    color: #fff;
    font-size: .8125rem;
    line-height: 1.3;
    pointer-events: none;
    white-space: nowrap;
}

[data-bs-theme="dark"] .nohu-ipucu { background: #f1f1f4; color: #1e2129; }

.nohu-ipucu[hidden] { display: none; }

/* ---------------------------------------------------------------
   Kullanıcı alanı: avatar 36 × 36, ad 14 px yarı kalın, aktif rol 12 px (Rehber §4).
   --------------------------------------------------------------- */
.nohu-kullanici {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 44px;
    padding: .2rem .5rem .2rem .25rem;
    border: 0;
    border-radius: 2rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.nohu-kullanici:hover { background: var(--nohu-vurgu-zemin); }

.nohu-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nohu-turkuaz);
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    object-fit: cover;
}

.nohu-kullanici-ad { display: block; font-size: .875rem; font-weight: 600; line-height: 1.2; }
.nohu-kullanici-rol { display: block; font-size: .75rem; color: var(--nohu-soluk); line-height: 1.2; }

/* Dar ekranda ad ve rol menünün içine alınır (Rehber §3). */
@media (max-width: 767.98px) {
    .nohu-kullanici-metin { display: none; }
}

/* Kullanıcı menüsü: 320 px; dar ekranda kenarlardan en az 16 px (Rehber §4). */
.nohu-kullanici-menu {
    width: 320px;
    max-width: calc(100vw - 32px);
}

.nohu-menu-baslik {
    padding: .25rem .5rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--nohu-soluk);
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* ---------------------------------------------------------------
   Görünüm seçimi: Açık / Koyu / Sistem — üç seçenekli tek grup (radyo düğmesi).
   --------------------------------------------------------------- */
.nohu-tema-secim {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .25rem;
    margin: 0 .5rem .25rem;
    padding: .2rem;
    border: 1px solid var(--nohu-cizgi);
    border-radius: .5rem;
}

.nohu-tema-secim input { position: absolute; opacity: 0; pointer-events: none; }

.nohu-tema-secim label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-height: 36px;
    border-radius: .375rem;
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--nohu-metin);
}

.nohu-tema-secim label:hover { background: var(--nohu-vurgu-zemin); }

/* Seçili olan yalnız renkle anlatılmaz: kalın yazı ve çerçeve de değişir (Rehber §9). */
.nohu-tema-secim input:checked + label {
    background: var(--nohu-vurgu-zemin);
    box-shadow: inset 0 0 0 1px var(--nohu-turkuaz);
    font-weight: 700;
}

/* ---------------------------------------------------------------
   Footer: solda "© yıl NOHU – Bilgi İşlem Daire Başkanlığı", sağda kısa sürüm.
   Kısa sayfada altta, uzun sayfada içerik sonunda; dar ekranda alt alta (Rehber §7).
   Yerleşimi uygulamanın düzeni verir; burada yalnız içerik dizilimi var.
   --------------------------------------------------------------- */
.nohu-alt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    flex-wrap: wrap;
    font-size: .8125rem;
    color: var(--nohu-soluk);
}

.nohu-surum {
    color: inherit;
    border-radius: .25rem;
    cursor: help;
}

@media (max-width: 575.98px) {
    .nohu-alt { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------
   İlk yükleme ekranı (Rehber §8): sabit Üniversite amblemi, çevresinde ona değmeyen
   ince turkuaz halka, altında "Yükleniyor…". Uygulama adı tekrar edilmez.

   Görünür olması <html class="nohu-yukleniyor"> ile açılır; sınıfı layout'taki satır içi
   betik YALNIZ OTURUMUN İLK SAYFASINDA ekler, sayfa yüklenince nohu-arayuz.js kaldırır.
   Yapay bekleme yoktur: kısa sürede açılan sayfada ekran hiç belirmesin diye yalnız
   görünme anı 150 ms geciktirilir, kapanış beklenmez.
   --------------------------------------------------------------- */
.nohu-yukleme { display: none; }

.nohu-yukleniyor .nohu-yukleme,
.nohu-yukleme.nohu-yukleme-hata {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--nohu-yuzey);
    color: var(--nohu-metin);
    animation: nohu-belir .2s ease .15s both;
}

.nohu-yukleme-amblem {
    position: relative;
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nohu-yukleme-amblem img { width: 72px; height: 72px; display: block; }

/* Halka ambleme değmez: amblem 72 px, halka 112 px. */
.nohu-yukleme-amblem::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(0, 138, 154, .18);
    border-top-color: var(--nohu-turkuaz);
    animation: nohu-don 1s linear infinite;
}

.nohu-yukleme-metin { font-size: .9375rem; font-weight: 500; }

.nohu-yukleme-hata-metni { display: none; text-align: center; max-width: 22rem; padding: 0 1rem; }

/* Hata ya da zaman aşımında sonsuz animasyon yerine hata durumu (Rehber §8). */
.nohu-yukleme-hata .nohu-yukleme-amblem::before { animation: none; border-color: var(--nohu-cizgi); }
.nohu-yukleme-hata .nohu-yukleme-metin { display: none; }
.nohu-yukleme-hata .nohu-yukleme-hata-metni { display: block; }

@media (prefers-reduced-motion: reduce) {
    .nohu-yukleme-amblem::before { animation: none; border-color: var(--nohu-turkuaz); }
    .nohu-yukleniyor .nohu-yukleme { animation: none; }
}

@keyframes nohu-don { to { transform: rotate(360deg); } }
@keyframes nohu-belir { from { opacity: 0; } to { opacity: 1; } }
