/* =====================================================================
   CareerVision — MOBİL / UYGULAMA GÖRÜNÜMÜ  (css/app-mobile.css)
   ---------------------------------------------------------------------
   Hedef: telefonda yerel bir uygulama gibi davranmak.
     • Altta sabit sekme çubuğu (tab bar)
     • manage_content'te üç sütun yerine sekmeli tek sütun
     • Dokunmatik hedefler en az 44px
     • Çentik/ev tuşu güvenli alanları (safe-area)
   ===================================================================== */

:root {
  --cv-tabbar-h: 62px;
  --cv-safe-b: env(safe-area-inset-bottom, 0px);
}

/* iOS'ta form alanlarına odaklanınca sayfanın zoomlanmasını engelle */
@media (max-width: 900px) {
  input, select, textarea, button {
    font-size: max(16px, 1em);
  }
}

/* Dokunmatik hedef büyüklüğü */
@media (pointer: coarse) {
  button,
  .btn,
  a.btn,
  .menu-action,
  .category-menu-btn,
  .content-menu-btn {
    min-height: 44px;
  }
  .menu-action { padding-block: 10px; }
}

/* =====================================================================
   1) ALT SEKME ÇUBUĞU
   ===================================================================== */
.cv-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  height: calc(var(--cv-tabbar-h) + var(--cv-safe-b));
  padding-bottom: var(--cv-safe-b);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, .07);
}

html[data-theme="dark"] .cv-tabbar {
  background: rgba(17, 28, 43, .94);
  border-top-color: #26364a;
}

.cv-tabbar-inner {
  display: flex;
  height: var(--cv-tabbar-h);
  align-items: stretch;
  max-width: 640px;
  margin: 0 auto;
}

.cv-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #64748b;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
}

.cv-tab i,
.cv-tab svg {
  font-size: 19px;
  width: 22px;
  height: 22px;
}

.cv-tab.is-active { color: #4c5f7f; }
html[data-theme="dark"] .cv-tab.is-active { color: #8fb6e6; }

.cv-tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: currentColor;
}

.cv-tab { position: relative; }

.cv-tab:active { transform: scale(.94); }

@media (max-width: 900px) {
  body.dashboard-page .cv-tabbar,
  body.manage-page .cv-tabbar,
  body.admin-page .cv-tabbar { display: block; }

  body.dashboard-page,
  body.manage-page,
  body.admin-page {
    padding-bottom: calc(var(--cv-tabbar-h) + var(--cv-safe-b)) !important;
  }
}

/* =====================================================================
   2) "ANA EKRANA EKLE" ŞERİDİ
   ===================================================================== */
.cv-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--cv-tabbar-h) + var(--cv-safe-b) + 12px);
  z-index: 3500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dde4ee;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .18);
  animation: cvBannerUp .25s ease-out;
}

html[data-theme="dark"] .cv-install-banner {
  background: #16212f;
  border-color: #2a3a4f;
  color: #e7eefb;
}

@keyframes cvBannerUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.cv-install-banner img { border-radius: 8px; flex: 0 0 auto; }

.cv-install-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cv-install-text strong { font-size: 13.5px; }
.cv-install-text span { font-size: 11.5px; color: #64748b; }

.cv-install-yes {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #4c5f7f;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.cv-install-no {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
}

@media (min-width: 901px) { .cv-install-banner { display: none; } }

/* =====================================================================
   3) manage_content.php — MOBİLDE SEKMELİ TEK SÜTUN
   ===================================================================== */
.cv-view-switch {
  display: none;
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

html[data-theme="dark"] .cv-view-switch {
  background: rgba(17, 28, 43, .96);
  border-bottom-color: #26364a;
}

.cv-view-switch button {
  flex: 1 1 0;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(100, 116, 139, .12);
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cv-view-switch button.is-active {
  background: #4c5f7f;
  color: #fff;
}

@media (max-width: 900px) {
  body.manage-page .cv-view-switch { display: flex; }

  body.manage-page .container {
    display: block !important;
    padding: 0 !important;
  }

  body.manage-page .container > .column {
    display: none !important;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    border: 0 !important;
    box-sizing: border-box;
    padding: 12px !important;
  }

  body.manage-page .container > .column.cv-view-active { display: block !important; }

  body.manage-page .pdf-preview .iframe-container {
    height: calc(var(--cv-vh, 1vh) * 100 - 210px);
    min-height: 380px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.manage-page .category-item { margin-bottom: 8px; }

  body.manage-page .category-name {
    min-height: 52px;
    font-size: 15px;
  }

  body.manage-page .side-action-stack {
    position: sticky;
    top: 56px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  body.manage-page .side-action-stack button { min-height: 46px; }

  /* Üst başlık çubuğu mobilde sadeleşsin */
  body.manage-page .header-bar { padding: 8px 10px; }
  body.manage-page .header-bar .cv-date-line { font-size: 11px; }
  body.manage-page .header-bar .header-buttons { flex-wrap: wrap; }
}

/* =====================================================================
   4) dashboard.php — MOBİL KART AKIŞI
   ===================================================================== */
@media (max-width: 900px) {
  body.dashboard-page .cv-grid,
  body.dashboard-page .cards,
  body.dashboard-page .cv-list {
    grid-template-columns: 1fr !important;
    display: grid !important;
    gap: 10px;
  }

  body.dashboard-page .card,
  body.dashboard-page .cv-card {
    border-radius: 14px;
  }
}

/* =====================================================================
   5) GİRİŞ / KAYIT SAYFALARI
   ===================================================================== */
@media (max-width: 640px) {
  body.auth-page {
    height: auto !important;
    min-height: calc(var(--cv-vh, 1vh) * 100);
    overflow: auto !important;
    padding: 24px 16px calc(24px + var(--cv-safe-b));
    align-items: flex-start !important;
  }

  body.auth-page .login-container,
  body.auth-page .form-container {
    max-width: none;
    width: 100%;
    margin-top: 8vh;
  }
}

/* =====================================================================
   6) STANDALONE (ana ekrandan açılmış) İNCE AYARLAR
   ===================================================================== */
html.cv-standalone body {
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-user-select: none;
  user-select: none;
}

html.cv-standalone input,
html.cv-standalone textarea,
html.cv-standalone [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* Yatay taşmayı kesin olarak engelle */
@media (max-width: 900px) {
  html, body { max-width: 100%; overflow-x: hidden; }
}

/* =====================================================================
   7) YÜZEN DİL KUTUSU  (js/i18n-static.js tarafından eklenir)
   ---------------------------------------------------------------------
   Dil ve tema ayarları tek yerden — ana sayfadaki (dashboard) yan
   menüden — yönetilir. Uygulama ekranlarında sağ altta duran yüzen dil
   kutusu gizlenir; giriş/kayıt ve tanıtım sayfalarında kalır.
   ===================================================================== */
body.manage-page .cv-i18n-switcher,
body.has-app-sidebar .cv-i18n-switcher,
body.in-app-page .cv-i18n-switcher,
body.popup-page .cv-i18n-switcher,
body.admin-page .cv-i18n-switcher,
body.embedded-preview .cv-i18n-switcher {
  display: none !important;
}

/* Menülerdeki "Kapat" satırı */
.menu-action.menu-close {
  border-top: 1px solid rgba(127, 143, 168, .22);
  margin-top: 4px;
  opacity: .78;
}
