/* ==========================================================
   AcilYanDal - Mobil Uyum ve Yayına Hazırlık Stil Paketi v1
   Bu dosya mevcut tasarımı bozmadan responsive davranışı güçlendirir.
   ========================================================== */
:root {
  --ayd-mobile-bg: #f6f8fc;
  --ayd-mobile-line: rgba(15,23,42,.10);
  --ayd-mobile-shadow: 0 16px 44px rgba(15,23,42,.10);
  --ayd-mobile-radius: 22px;
}
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 92px; }
body { min-width: 320px; overflow-x: hidden; }
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
iframe { border: 0; }
pre, code, kbd, samp { white-space: pre-wrap; overflow-wrap: anywhere; }
a, button, .btn { touch-action: manipulation; }
input, select, textarea { max-width: 100%; }
.table { margin-bottom: 0; }
.ayd-scroll-x, .table-responsive, .ayd-mobile-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}
.ayd-mobile-table-wrap > table { min-width: 760px; }
.ayd-mobile-soft-card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: var(--ayd-mobile-radius);
  box-shadow: var(--ayd-mobile-shadow);
}
.ayd-main-content { overflow-x: clip; }
.ayd-main-content .container,
.ayd-main-content .container-fluid { max-width: min(1320px, calc(100vw - 24px)); }
.ayd-section, section { position: relative; }

/* Navbar: masaüstünü korur, tablet/mobilde okunabilir panel yapar */
.ayd-navbar { z-index: 1040; }
.ayd-navbar .navbar-toggler {
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 14px;
  padding: .55rem .7rem;
  color: #fff;
  box-shadow: none !important;
}
.ayd-navbar .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(255,255,255,.14) !important; }
.ayd-navbar .navbar-toggler-icon { filter: invert(1) grayscale(1) brightness(3); }
@media (max-width: 1199.98px) {
  .ayd-navbar .container, .ayd-navbar .container-fluid, .ayd-navbar .ayd-nav-container {
    padding-left: max(14px, env(safe-area-inset-left)) !important;
    padding-right: max(14px, env(safe-area-inset-right)) !important;
  }
  .ayd-navbar .navbar-collapse {
    width: 100%;
    max-height: calc(100dvh - 86px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    border: 1px solid rgba(255,255,255,.10);
  }
  .ayd-navbar .dropdown-menu {
    position: static !important;
    transform: none !important;
    width: 100%;
    margin: .35rem 0 .7rem !important;
    max-height: none !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) !important;
  }
  .ayd-navbar .nav-link, .ayd-navbar .dropdown-item { min-height: 44px; }
}
@media (max-width: 575.98px) {
  .ayd-brand { font-size: 1.18rem !important; }
  .brand-icon { font-size: 1.35rem !important; }
  .ayd-main-content { padding-top: 66px !important; }
}

/* Hero / başlık alanları */
.ayd-hero, .page-hero, .hero, .profile-hero, .error-shell, .ayd-pro-ui .hero {
  isolation: isolate;
}
@media (max-width: 991.98px) {
  .ayd-hero { padding: 4.3rem 0 2.8rem !important; }
  .ayd-hero h1 { font-size: clamp(2.1rem, 7vw, 3.1rem) !important; }
  .ayd-hero .lead { font-size: 1.02rem !important; }
  .hero-stats { gap: .8rem !important; }
  .hero-stat { flex: 1 1 calc(50% - .8rem); padding: .9rem 1rem !important; }
}
@media (max-width: 575.98px) {
  .ayd-hero { padding: 3.35rem 0 2.15rem !important; border-radius: 0 0 26px 26px; }
  .hero-stats { display: grid !important; grid-template-columns: 1fr 1fr; width: 100%; }
  .hero-stat .number { font-size: 1.45rem !important; }
  .hero-stat .label { font-size: .68rem !important; }
}

/* Kartlar / gridler */
.ayd-card, .card, .exam-card, .spot-card, .course-card, .lesson-card, .clinical-tool-card {
  overflow-wrap: anywhere;
}
.ayd-card .card-body, .card .card-body { min-width: 0; }
.card-title, .lesson-title, .course-title, .exam-title { overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .row { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
  .ayd-card { border-radius: 18px !important; }
  .ayd-card:hover, .exam-card:hover { transform: none !important; }
  .ayd-card .card-body { padding: 1rem !important; }
  .exam-card { border-radius: 18px !important; padding: 1rem !important; }
  .exam-card .exam-meta { gap: .6rem !important; }
}

/* Formlar */
.form-control, .form-select, .btn, button, input, textarea, select { font-size: 16px; }
.form-control, .form-select { border-radius: 12px; }
textarea { resize: vertical; }
@media (max-width: 575.98px) {
  .btn { min-height: 44px; }
  .btn-group, .btn-toolbar { flex-wrap: wrap; gap: .45rem; }
  .btn-group > .btn, .btn-toolbar .btn { border-radius: 12px !important; }
  .modal-dialog { margin: .75rem; }
  .modal-content { border-radius: 22px; }
  .toast, .admin-feedback-toast { max-width: calc(100vw - 24px) !important; }
}

/* Ders okuma / video / klinik araç */
.lesson-content, .lesson-body, .content-body, .markdown-body, .textbook-content {
  overflow-wrap: anywhere;
}
.lesson-content table, .content-body table, .markdown-body table, .textbook-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}
.lesson-content img, .content-body img, .markdown-body img { border-radius: 14px; }
.video-wrapper, .ratio, .embed-responsive, .video-player-wrap {
  max-width: 100%;
  overflow: hidden;
  border-radius: 18px;
}
@media (max-width: 767.98px) {
  .lesson-content, .lesson-body, .content-body, .markdown-body { font-size: .98rem; line-height: 1.72; }
  .lesson-content h1, .content-body h1, .markdown-body h1 { font-size: 1.8rem; }
  .lesson-content h2, .content-body h2, .markdown-body h2 { font-size: 1.45rem; }
  .lesson-content h3, .content-body h3, .markdown-body h3 { font-size: 1.22rem; }
}

/* Profil / üyelik */
.profile-page .profile-hero, .profile-hero, .ayd-profile-hero {
  border-radius: 28px !important;
}
@media (max-width: 991.98px) {
  .profile-page .profile-sidebar, .profile-sidebar { margin-bottom: 1rem; }
  .profile-page .nav-pills, .profile-tabs, .profile-nav {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    gap: .55rem;
    padding-bottom: .35rem;
    -webkit-overflow-scrolling: touch;
  }
  .profile-page .nav-pills .nav-link, .profile-tabs .nav-link, .profile-nav .nav-link {
    white-space: nowrap;
    flex: 0 0 auto;
    border-radius: 14px;
  }
}
@media (max-width: 575.98px) {
  .profile-hero, .ayd-profile-hero { padding: 1.3rem !important; border-radius: 22px !important; }
  .profile-hero h1, .ayd-profile-hero h1 { font-size: 2rem !important; }
}

/* AI widget / floating action alanları */
.ai-assistant-widget, .ayd-ai-widget, .floating-ai, .floating-action, .floating-magic-btn {
  max-width: calc(100vw - 24px);
}
@media (max-width: 575.98px) {
  .ai-assistant-widget, .ayd-ai-widget { right: 12px !important; bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
  .floating-action, .floating-magic-btn { right: 14px !important; bottom: calc(14px + env(safe-area-inset-bottom)) !important; }
}

/* Footer */
.ayd-footer { overflow: hidden; }
@media (max-width: 767.98px) {
  .ayd-footer { text-align: left; }
  .ayd-footer .footer-brand { font-size: 1.35rem; }
  .footer-links li { margin-bottom: .4rem; }
}

/* Admin panel mobil güçlendirme */
.admin-main { min-width: 0; }
.admin-content { overflow-x: clip; }
.admin-content img, .admin-content iframe { max-width: 100%; }
.admin-content .card, .admin-content .stat-card, .admin-content .alert { overflow-wrap: anywhere; }
.admin-content .table-responsive, .admin-content .ayd-mobile-table-wrap {
  border: 1px solid rgba(15,23,42,.08);
  background: #fff;
}
.admin-content .table-responsive table, .admin-content .ayd-mobile-table-wrap table { min-width: 860px; }
@media (max-width: 991.98px) {
  .admin-sidebar { width: min(88vw, 330px) !important; }
  .admin-topbar { gap: .75rem; }
  .admin-topbar > div { min-width: 0; }
  .admin-topbar h5 { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-topbar .btn-outline-primary { max-width: 44px; overflow: hidden; white-space: nowrap; }
  .admin-topbar .btn-outline-primary i { margin-right: 0 !important; }
  .admin-content { padding: 1rem !important; }
  .admin-content h1 { font-size: 1.75rem; }
  .admin-content h2 { font-size: 1.45rem; }
  .admin-content .row { --bs-gutter-x: .9rem; --bs-gutter-y: .9rem; }
}
@media (max-width: 575.98px) {
  .admin-topbar { padding: .7rem .75rem !important; }
  .admin-topbar h5 { font-size: 1rem; max-width: 44vw; }
  .admin-topbar .text-muted { display: none; }
  .admin-content { padding: .75rem !important; }
  .admin-content .card-body { padding: 1rem; }
  .admin-content .btn { width: auto; }
  .admin-content .d-flex.gap-2, .admin-content .d-flex.gap-3 { flex-wrap: wrap; }
  .admin-content form .row > [class*="col-"] { margin-bottom: .35rem; }
}

/* Mobilde yatay taşmaya neden olan elemanları yumuşat */
@media (max-width: 767.98px) {
  [style*="width:"] { max-width: 100%; }
  .w-75, .w-50, .w-25 { width: 100% !important; }
  .display-1 { font-size: 3rem; }
  .display-2 { font-size: 2.6rem; }
  .display-3 { font-size: 2.25rem; }
  .display-4 { font-size: 2rem; }
  .display-5 { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
