/* ============================================================
   PrizmaPack — yükleme ekranı, logo ve arayüz animasyonları
   ============================================================ */

:root {
    --pp-ink: #0b1f3a;
    --pp-accent: #0a84ff;
}

/* ---------- Yükleme ekranı (splash) ---------- */
.pp-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 600px at 50% 35%, #16335c 0%, #0b1f3a 55%, #061327 100%);
    transition: opacity .5s ease, visibility .5s ease;
}

/* JS, sayfa hazır olunca body'ye bu sınıfı ekler */
body.pp-ready .pp-loader {
    opacity: 0;
    visibility: hidden;
}

/* Geri/ileri tuşuyla dönüşte yeniden göstermek için */
body.pp-navigating .pp-loader {
    opacity: 1;
    visibility: visible;
}

.pp-loader-inner {
    text-align: center;
    color: #eaf2ff;
    animation: ppFloat 3s ease-in-out infinite;
}

.pp-logo-wrap {
    filter: drop-shadow(0 0 14px rgba(80, 160, 255, .55));
}

.pp-brand {
    margin-top: 14px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .5px;
    color: #fff;
}

.pp-brand span {
    background: linear-gradient(90deg, #ff9500, #ffd60a, #34c759, #0a84ff, #bf5af2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pp-tagline {
    margin-top: 2px;
    font-size: .8rem;
    opacity: .7;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.pp-bar {
    margin: 18px auto 0;
    width: 180px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .15);
    overflow: hidden;
    position: relative;
}

.pp-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    border-radius: 4px;
    background: linear-gradient(90deg, #0a84ff, #34c759, #ffd60a);
    animation: ppSlide 1.1s ease-in-out infinite;
}

/* ---------- Logo animasyonları ---------- */
.pp-loader .pp-prism {
    transform-origin: 50% 50%;
    animation: ppGlow 2.2s ease-in-out infinite;
}

.pp-loader .pp-rays line {
    stroke-dasharray: 44;
    stroke-dashoffset: 44;
    animation: ppDraw 1.6s ease-in-out infinite;
}

.pp-loader .pp-rays line:nth-child(1) { animation-delay: .00s; }
.pp-loader .pp-rays line:nth-child(2) { animation-delay: .08s; }
.pp-loader .pp-rays line:nth-child(3) { animation-delay: .16s; }
.pp-loader .pp-rays line:nth-child(4) { animation-delay: .24s; }
.pp-loader .pp-rays line:nth-child(5) { animation-delay: .32s; }
.pp-loader .pp-rays line:nth-child(6) { animation-delay: .40s; }

.pp-loader .pp-beam-in {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: ppDraw 1.6s ease-in-out infinite;
}

/* Navbar logosu: hover'da hafif dönüş */
.navbar-brand .pp-logo {
    transition: transform .5s ease, filter .5s ease;
    vertical-align: -8px;
}
.navbar-brand:hover .pp-logo {
    transform: rotate(-12deg) scale(1.08);
    filter: drop-shadow(0 0 6px rgba(120, 180, 255, .8));
}

/* ---------- Sayfa içi giriş animasyonları ---------- */
main[role="main"] {
    animation: ppFadeUp .45s ease both;
}

/* Kartlar: girişte yumuşak yüksel + hover'da kalk */
.card {
    animation: ppFadeUp .5s ease both;
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 1.5rem rgba(13, 38, 76, .15) !important;
}

/* Panel istatistik kartlarını sırayla getir (stagger) */
.row.g-3 > [class*="col-"]:nth-child(1) .card { animation-delay: .02s; }
.row.g-3 > [class*="col-"]:nth-child(2) .card { animation-delay: .07s; }
.row.g-3 > [class*="col-"]:nth-child(3) .card { animation-delay: .12s; }
.row.g-3 > [class*="col-"]:nth-child(4) .card { animation-delay: .17s; }
.row.g-3 > [class*="col-"]:nth-child(5) .card { animation-delay: .22s; }
.row.g-3 > [class*="col-"]:nth-child(6) .card { animation-delay: .27s; }

/* Tablo satırları: hover vurgusu + yumuşak görünme */
.table tbody tr {
    transition: background-color .15s ease, transform .15s ease;
}
.table-hover tbody tr:hover,
.table-striped tbody tr:hover {
    background-color: rgba(10, 132, 255, .08);
}

/* Butonlar */
.btn {
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}
.btn:active {
    transform: translateY(0) scale(.98);
}

/* Rozetler hafif belirme */
.badge {
    animation: ppPop .35s ease both;
}

/* Uyum matrisi hücreleri: sırayla "pop" */
table.matrix tbody td {
    animation: ppPop .4s ease both;
}

/* Sayaç (count-up) vurgusu */
.pp-count {
    font-variant-numeric: tabular-nums;
}

/* Üst ince ilerleme çubuğu (sayfa geçişinde) */
#pp-topbar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    z-index: 2100;
    background: linear-gradient(90deg, #0a84ff, #34c759, #ffd60a, #ff9500);
    box-shadow: 0 0 8px rgba(10, 132, 255, .6);
    transition: width .3s ease, opacity .4s ease;
    opacity: 0;
}
#pp-topbar.pp-active {
    opacity: 1;
}

/* ---------- Keyframes ---------- */
@keyframes ppFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ppPop {
    0%   { opacity: 0; transform: scale(.85); }
    70%  { transform: scale(1.04); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes ppFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
@keyframes ppGlow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(120, 180, 255, .4)); }
    50%      { filter: drop-shadow(0 0 12px rgba(120, 180, 255, .9)); }
}
@keyframes ppDraw {
    0%   { stroke-dashoffset: 44; opacity: .2; }
    45%  { stroke-dashoffset: 0;  opacity: 1; }
    80%  { stroke-dashoffset: 0;  opacity: 1; }
    100% { stroke-dashoffset: 44; opacity: .2; }
}
@keyframes ppSlide {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ============================================================
   Admin panel düzeni (yan menü)
   ============================================================ */
body { margin-bottom: 0; background: #f4f6fb; }

.pp-app { display: flex; min-height: 100vh; }

.pp-sidebar {
    width: 264px;
    flex-shrink: 0;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1030;
    background: linear-gradient(180deg, #0b1f3a 0%, #071528 100%);
    color: #cdd9ec;
    transition: transform .25s ease;
    padding-bottom: 1rem;
}

.pp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 1rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #0b1f3a, #0b1f3aee);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.pp-nav-group-title {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #65809f;
    padding: 1rem 1rem .35rem;
}

.pp-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1rem;
    color: #cdd9ec;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease, padding-left .15s ease;
}
.pp-nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    padding-left: 1.2rem;
}
.pp-nav-link.active {
    background: rgba(10, 132, 255, .18);
    border-left-color: #0a84ff;
    color: #fff;
    font-weight: 600;
}
.pp-nav-link.pp-accent { color: #ffd60a; }
.pp-nav-link.pp-accent:hover { color: #fff; }
.pp-nav-ico { width: 1.4rem; text-align: center; font-size: 1rem; }

.pp-sidebar-foot {
    margin-top: 1rem;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: #6b86ad;
    line-height: 1.4;
}

.pp-main {
    margin-left: 264px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pp-appbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    border-bottom: 1px solid #e5e9f0;
    padding: .55rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    box-shadow: 0 1px 4px rgba(13, 38, 76, .05);
}
.pp-page-title { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--pp-ink); }

.pp-content { flex: 1; padding: 1.1rem 1.25rem; animation: ppFadeUp .45s ease both; }

.pp-foot { padding: .75rem 1.25rem; border-top: 1px solid #e5e9f0; background: #fff; }

.pp-sidebar-toggle { display: none; }
.pp-backdrop { display: none; }

@media (max-width: 991.98px) {
    .pp-sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
    body.pp-sidebar-open .pp-sidebar { transform: translateX(0); }
    .pp-main { margin-left: 0; }
    .pp-sidebar-toggle { display: inline-flex; }
    body.pp-sidebar-open .pp-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1025;
        background: rgba(3, 12, 26, .5);
    }
}

/* Hareket azaltma tercihi olanlara saygı */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
