/* ================================================================
   CTECH SERVICE PLATFORM — BASE.CSS
   Reset, body, global animasiyalar, mobil app davranışı
   Heç bir komponent stili yoxdur — yalnız təməl qaydalar
   ================================================================ */

/* ===== RESET & BODY ===== */
* { box-sizing:border-box; }
a { text-decoration:none; color:inherit; }
html,body { height:100%; margin:0; -webkit-text-size-adjust:100%; text-size-adjust:100%; overscroll-behavior-y:contain; }
body { min-height:100vh; background:#F4F8FD; background-image:radial-gradient(circle at 12% 8%,rgba(59,130,246,.10),transparent 45%),radial-gradient(circle at 90% 90%,rgba(78,147,250,.10),transparent 45%); font-family:'Inter',Arial,sans-serif; }

/* ===== QLOBAL ANİMASİYALAR ===== */
@keyframes spin    { to{ transform:rotate(360deg); } }
@keyframes popIn   { 0%{ transform:scale(.4); opacity:0; } 100%{ transform:scale(1); opacity:1; } }
@keyframes pulse   { 0%{ box-shadow:0 0 0 0 rgba(63,203,120,.5); } 70%{ box-shadow:0 0 0 6px rgba(63,203,120,0); } 100%{ box-shadow:0 0 0 0 rgba(63,203,120,0); } }
@keyframes warnToastIn { from{ transform:translateY(-14px); opacity:0; } to{ transform:translateY(0); opacity:1; } }
@keyframes ctdPulse { 0%{ box-shadow:0 0 0 0 rgba(84,214,138,.55); } 70%{ box-shadow:0 0 0 6px rgba(84,214,138,0); } 100%{ box-shadow:0 0 0 0 rgba(84,214,138,0); } }
/* v4.29: Əmrlərdən sonra vidgetlərin giriş animasiyası — yumşaq "pop" effekti */
@keyframes appToastPop { 0%{ transform:translateX(-50%) translateY(-10px) scale(.95); opacity:0; } 60%{ transform:translateX(-50%) translateY(3px) scale(1.015); opacity:1; } 100%{ transform:translateX(-50%) translateY(0) scale(1); } }
@keyframes appConfirmPop { 0%{ transform:translateY(12px) scale(.95); opacity:0; } 100%{ transform:translateY(0) scale(1); opacity:1; } }

/* ═══ v4.27: SAYT DAXİLİ VİDGETLƏR (native alert()/confirm() əvəzinə) ═══ */
#appToastWidget{
  position:fixed; top:18px; left:50%; transform:translateX(-50%) translateY(-16px);
  z-index:99999; display:flex; align-items:center; gap:10px;
  max-width:min(560px, calc(100vw - 32px));
  padding:12px 18px; border-radius:13px;
  font-family:'Inter',sans-serif; font-size:13.5px; font-weight:600; line-height:1.45;
  color:#fff; box-shadow:0 18px 44px rgba(12,26,48,.28);
  opacity:0; pointer-events:none; transition:opacity .25s ease, transform .25s ease;
}
#appToastWidget.show{ opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto; animation:appToastPop .28s cubic-bezier(.34,1.56,.64,1); }
.app-toast-ok{ background:#0E8C7A; }
.app-toast-err{ background:#DC2626; }
.app-toast-warn{ background:#D97706; }
.app-toast-info{ background:#2F6FED; }
.app-toast-ic{
  flex:0 0 auto; width:22px; height:22px; border-radius:50%;
  background:rgba(255,255,255,.24); display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:800;
}
.app-toast-tx{ white-space:pre-line; }
body.dark-mode #appToastWidget{ box-shadow:0 18px 44px rgba(0,0,0,.55); }

.app-confirm-overlay{
  position:fixed; inset:0; z-index:99998; display:flex; align-items:center; justify-content:center;
  background:rgba(13,26,46,.55); padding:24px;
  opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.app-confirm-overlay.open{ opacity:1; pointer-events:auto; }
.app-confirm-box{
  background:#fff; border-radius:18px; padding:24px 26px; max-width:440px; width:100%;
  box-shadow:0 24px 60px rgba(18,35,59,.3); position:relative;
  transform:translateY(10px) scale(.98); transition:transform .18s ease;
  font-family:'Inter',sans-serif;
}
.app-confirm-overlay.open .app-confirm-box{ transform:translateY(0) scale(1); animation:appConfirmPop .22s cubic-bezier(.34,1.56,.64,1); }
.app-confirm-x{
  position:absolute; top:12px; right:14px; background:none; border:none;
  font-size:16px; color:#8AA0B8; cursor:pointer; padding:4px;
}
.app-confirm-title{ font-size:16px; font-weight:700; color:#12233B; margin-bottom:10px; padding-right:24px; }
.app-confirm-text{ font-size:13.5px; color:#5C7089; line-height:1.55; white-space:pre-line; margin-bottom:20px; }
.app-confirm-btns{ display:flex; gap:10px; justify-content:flex-end; }
.app-confirm-btns button{
  border:none; border-radius:11px; padding:10px 18px; font-family:'Inter',sans-serif;
  font-size:13px; font-weight:700; cursor:pointer; transition:background .15s ease;
}
.app-confirm-cancel{ background:#F0F4FB; color:#33445E; }
.app-confirm-cancel:hover{ background:#E1EAF6; }
.app-confirm-ok{ background:#2F6FED; color:#fff; }
.app-confirm-ok:hover{ background:#2660D6; }
.app-confirm-ok-danger{ background:#DC2626; }
.app-confirm-ok-danger:hover{ background:#C31414; }
body.dark-mode .app-confirm-box{ background:#16212E; }
body.dark-mode .app-confirm-title{ color:#E8EEF5; }
body.dark-mode .app-confirm-text{ color:#9CB2CE; }
body.dark-mode .app-confirm-cancel{ background:#1C2A3C; color:#C7D5E8; }

/* ===== MOBİL APP DAVRANIŞI ===== */

/* 300ms tıklama gecikməsini aradan qaldırır */
button, a, .card-big, .card-small, .icon-btn, .menu-item,
.bs-home-btn, .rpt-icon-btn, .dash-tab, [onclick]{
  touch-action:manipulation;
}

/* Toxunanda boz-flaş highlight effektini söndürür */
button, a, [onclick], .card-big, .card-small, .icon-btn{
  -webkit-tap-highlight-color:transparent;
}

/* Uzun basanda native kontekst menyu çıxmasın */
button, .icon-btn, .card-big, .card-small, .bs-home-btn, .rpt-icon-btn{
  -webkit-touch-callout:none;
}

/* Düymə/kart mətnləri təsadüfən seçilməsin */
button, .icon-btn, .card-big, .card-small, .menu-item, .dash-tab,
.rpt-icon-btn, .bs-home-btn, .header, .rpt-header, .bs-header{
  -webkit-user-select:none;
  user-select:none;
}

/* iOS-da momentum scroll */
.modal-box, .dash-modal-results, .dash-modal-left, .dash-modal-right{
  -webkit-overflow-scrolling:touch;
}

@media (max-width:900px){
  html, body{ overscroll-behavior:none; }
  #busServiceView, #tvmServiceView, #busBulkView,
  #busReportView, #tvmReportView, #busDetailView, #tvmDetailView,
  #busDashboardView{
    -webkit-overflow-scrolling:touch;
  }
}

/* ===== GECƏ/GÜNDÜZ DÜYMƏSİ — YALNIZ MOBİL ===== */
/* toggleTheme() funksiyası yalnız mobil (≤900px) üçündür, desktop-da işləmir.
   Bu düymələr desktop-da gizlədilir. */
@media (min-width:901px){
  #rptThemeBtn, #ongThemeBtn, #tvmRptThemeBtn, #tvmOngThemeBtn, #dashThemeBtn, #bkThemeBtn{
    display:none !important;
  }
}

/* ===== VERSİYA GÖSTƏRİCİSİ — copyright mətninin SOLUNDA, eyni sətirdə (v4.12) ===== */
.app-version{
  display:inline-block; font-size:11px; font-weight:600; letter-spacing:.5px;
  color:#5C7089; margin-right:10px; font-family:'Inter',sans-serif;
  opacity:.85; vertical-align:middle;
}
body.dark-mode .app-version{ color:#8FA3BF; }

/* ===== SPLASH EKRANI (v4.79) — mobil/app açılışında fırlanan texniki ikon ===== */
#ctechSplash{
  position:fixed; inset:0; z-index:999997;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(120% 90% at 50% 0%, #16345E 0%, #0D2035 58%, #0A1A2C 100%);
  font-family:'Inter',sans-serif;
  opacity:1; visibility:visible;
  transition:opacity .45s ease, visibility .45s ease;
  -webkit-tap-highlight-color:transparent;
}
#ctechSplash::before{
  content:''; position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size:44px 44px;
}
#ctechSplash.ctech-splash-hide{ opacity:0; visibility:hidden; }
.ctech-splash-inner{
  position:relative; display:flex; flex-direction:column; align-items:center;
  text-align:center; padding:24px; max-width:86vw;
}
.ctech-splash-icon{
  position:relative; width:104px; height:104px; margin-bottom:28px;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 32% 28%, #1B3A63, #0E2138 72%);
  border:1px solid rgba(120,170,255,.22);
  box-shadow:0 18px 48px rgba(2,10,22,.55), inset 0 1px 0 rgba(255,255,255,.08);
  animation:ctechSplashPop .55s cubic-bezier(.2,.85,.3,1.05) both;
}
.ctech-splash-gear{
  position:absolute; width:80px; height:80px;
  animation:ctechSplashSpin 5s linear infinite;
}
.ctech-splash-wrench{
  position:absolute; width:42px; height:42px;
  filter:drop-shadow(0 3px 6px rgba(0,0,0,.35));
  animation:ctechSplashWrench .55s cubic-bezier(.34,1.56,.64,1) .15s both;
}
@keyframes ctechSplashSpin{ to{ transform:rotate(360deg); } }
@keyframes ctechSplashPop{ from{ transform:scale(.72); opacity:0; } to{ transform:scale(1); opacity:1; } }
@keyframes ctechSplashWrench{ from{ transform:translateY(8px) scale(.78); opacity:0; } to{ transform:translateY(0) scale(1); opacity:1; } }
.ctech-splash-brand{
  font-family:'Rajdhani','Inter',sans-serif;
  font-size:22px; font-weight:700; letter-spacing:.14em;
  color:#E8EEF5; text-transform:uppercase; margin-bottom:6px;
}
.ctech-splash-brand span{ color:#4E93FA; }
.ctech-splash-sub{
  font-size:11.5px; letter-spacing:.34em; text-transform:uppercase;
  color:#8CA0BC; font-weight:600; margin-bottom:36px;
}
.ctech-splash-dots{ display:flex; gap:8px; }
.ctech-splash-dots span{
  width:8px; height:8px; border-radius:50%; background:#3B6FB0;
  animation:ctechSplashDot 1.2s ease-in-out infinite;
}
.ctech-splash-dots span:nth-child(2){ animation-delay:.18s; }
.ctech-splash-dots span:nth-child(3){ animation-delay:.36s; }
@keyframes ctechSplashDot{
  0%,100%{ opacity:.25; transform:translateY(0); }
  50%{ opacity:1; transform:translateY(-4px); background:#4E93FA; }
}
