/* ==========================================================================
   3G ÖZEL GÜVENLİK EĞİTİM MERKEZİ - RESPONSIVE & MEDYA SORGULARI (RESPONSIVE.CSS)
   Estetik: Dark Luxury Glassmorphism — Responsive Layer
   ========================================================================== */

/* 1. TABLET VE KÜÇÜK EKRANLAR (1024px ve altı) */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-text-col {
    text-align: center;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-trust-badges {
    justify-content: center;
  }

  .hero-rating-badge {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-badge-wrap {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    max-width: 550px;
    margin: 0 auto;
  }

  .two-col-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  /* ── Sınav: Tablet ── */
  .exam-workspace {
    grid-template-columns: 1fr 260px;
  }

  .exam-main-panel {
    padding: 1.5rem 2rem 0 2rem;
  }

  .exam-side-panel {
    padding: 1.25rem;
  }

  .exam-map-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
  }

  .map-btn {
    font-size: 0.78rem;
  }

  .exam-nav-bar {
    padding: 0.75rem 1.5rem;
  }
}

/* 2. MOBİL VE TABLET DİKEY (768px ve altı) */
@media (max-width: 768px) {
  .top-bar {
    display: none;
  }

  .mobile-toggle {
    display: block;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
  }

  .mobile-toggle:hover {
    background: rgba(90, 15, 232, 0.08);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(32, 0, 72, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu .nav-link {
    width: auto;
    padding: 0.85rem 1.5rem;
    font-size: 1.2rem;
    color: #ffffff;
    border-bottom: none;
    border-radius: var(--radius-md);
    text-align: center;
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active {
    background: rgba(90, 15, 232, 0.2);
    color: #ffffff;
  }

  .nav-menu .dropdown-menu {
    position: static;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: auto;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
  }

  .nav-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    border-left: none;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
  }

  .nav-menu .dropdown-item:hover {
    color: #ffffff;
    background: rgba(90, 15, 232, 0.15);
    padding-left: 1rem;
  }

  .hero-title {
    font-size: 2.35rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.85rem;
  }

  .page-title {
    font-size: 2.1rem;
  }

  .ticker-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .countdown-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .result-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  /* ── Sınav: Mobil Tam Ekran Düzeni ── */
  .exam-workspace {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
  }

  .exam-main-panel {
    padding: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .exam-question-body {
    padding: 0.75rem 0.85rem 1rem 0.85rem;
  }

  /* Header: Kompakt tek satır */
  .exam-header {
    padding: 0.45rem 0.65rem;
    min-height: 46px;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .exam-header-left {
    flex-shrink: 1;
    min-width: 0;
    gap: 0.35rem;
  }

  .exam-header-title {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
  }

  .exam-question-header-left {
    gap: 0.5rem;
  }

  .exam-q-badge {
    padding: 0.28rem 0.65rem;
    font-size: 0.7rem;
  }

  .exam-header-right {
    flex-shrink: 0;
    gap: 0.35rem;
  }

  .exam-theme-toggle span {
    display: none !important; /* Sadece ikon göster */
  }

  .exam-theme-toggle {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
  }

  .exam-timer-box {
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    gap: 0.3rem;
  }

  .btn-finish-header {
    font-size: 0.75rem;
    padding: 0.32rem 0.55rem;
    gap: 0.25rem;
  }

  #btnExitExam {
    padding: 0.32rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  /* Soru başlığı & metin */
  .exam-question-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    gap: 0.4rem;
  }

  .exam-question-header h3 {
    font-size: 0.92rem !important;
  }

  .exam-flag-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .exam-question-text {
    font-size: 0.96rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }

  /* Şıklar — okunabilir, dokunma dostu */
  .exam-options-list {
    gap: 0.45rem;
    margin-bottom: 0.85rem;
  }

  .exam-option-item {
    padding: 0.65rem 0.75rem;
    gap: 0.55rem;
    border-radius: 8px;
    min-height: 40px;
  }

  .exam-option-letter {
    width: 26px;
    height: 26px;
    font-size: 0.82rem;
  }

  .exam-option-content {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  /* Alt nav-bar: Kesinlikle ekranın altında sabit */
  .exam-nav-bar {
    padding: 0.5rem 0.65rem;
    gap: 0.35rem;
    flex-wrap: nowrap;
    z-index: 50;
  }

  .exam-nav-bar .btn {
    font-size: 0.78rem;
    padding: 0.5rem 0.4rem;
    min-height: 40px;
    flex: 1 1 0;
    white-space: nowrap;
    justify-content: center;
  }

  /* Mobil soru haritası toggle butonu — görünür yap */
  .exam-mobile-map-toggle {
    display: inline-flex;
  }

  /* Side panel — slide-up overlay */
  .exam-side-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 65vh;
    background: #0b1120;
    border-top: 2px solid rgba(56, 189, 248, 0.4);
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1rem 1.5rem 1rem;
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    animation: slideUpPanel 0.3s ease forwards;
  }

  .exam-side-panel.mobile-open {
    display: flex;
    flex-direction: column;
  }

  @keyframes slideUpPanel {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* Light mode side panel overlay */
  .exam-modal-fullscreen.light-mode .exam-side-panel {
    background: #ffffff;
    border-top-color: #2563eb;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.15);
  }

  /* Side panel overlay kapama butonu */
  .exam-side-panel-close {
    display: flex;
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.15s ease;
  }

  .exam-side-panel-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
  }

  .exam-modal-fullscreen.light-mode .exam-side-panel-close {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
  }

  .exam-map-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }

  .map-btn {
    font-size: 0.82rem;
    min-height: 36px;
  }

  /* Açıklama kutusu */
  .exam-explanation {
    padding: 1rem;
    margin-top: 0.75rem;
  }

  /* Sonuç kartı */
  .exam-result-card {
    padding: 1.5rem 1rem;
    margin: 1rem auto 3rem auto;
  }

  .result-score-circle {
    width: 110px;
    height: 110px;
  }

  .result-score-num {
    font-size: 2.2rem;
  }

  /* Konu analizi grid */
  .subject-analysis-grid {
    grid-template-columns: 1fr;
  }

  .ai-recommendation-box {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* 3. KÜÇÜK TELEFONLAR (480px ve altı) */
@media (max-width: 480px) {
  .hero {
    padding: 3rem 0 3.5rem 0;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat-card-number {
    font-size: 2rem;
  }

  .btn {
    width: 100%;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .floating-actions {
    bottom: 16px;
    right: 16px;
  }

  .float-btn {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .countdown-number {
    font-size: 1.3rem;
  }

  /* ── Sınav: Küçük Telefon ── */
  .exam-header {
    padding: 0.5rem 0.6rem;
  }

  .exam-header-title {
    font-size: 0.75rem;
  }

  .exam-timer-box {
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
  }

  .exam-question-text {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 0.75rem;
  }

  .exam-options-list {
    gap: 0.5rem;
  }

  .exam-option-item {
    padding: 0.7rem 0.75rem;
    gap: 0.5rem;
  }

  .exam-option-letter {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }

  .exam-option-content {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .exam-nav-bar {
    padding: 0.45rem 0.5rem;
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .exam-nav-bar .btn {
    font-size: 0.72rem;
    padding: 0.45rem 0.35rem;
    flex: 1 1 0;
    min-height: 38px;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
  }

  .exam-mobile-map-toggle {
    font-size: 0.72rem;
    padding: 0.35rem 0.6rem;
  }

  .exam-side-panel {
    max-height: 70vh;
  }

  .map-btn {
    font-size: 0.78rem;
    min-height: 32px;
  }

  .result-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
}

/* 4. KISA EKRANLAR VE YATAY TELEFONLAR (Düşey Yükseklik <= 700px) */
@media (max-height: 700px) {
  .exam-header {
    padding: 0.35rem 0.6rem;
    min-height: 42px;
  }

  .exam-question-body {
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
  }

  .exam-question-header {
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
  }

  .exam-question-text {
    font-size: 0.92rem;
    line-height: 1.45;
    margin-bottom: 0.5rem;
  }

  .exam-options-list {
    gap: 0.35rem;
    margin-bottom: 0.5rem;
  }

  .exam-option-item {
    padding: 0.5rem 0.65rem;
    min-height: 36px;
  }

  .exam-nav-bar {
    padding: 0.4rem 0.5rem;
  }

  .exam-nav-bar .btn {
    min-height: 36px;
    padding: 0.35rem 0.4rem;
    font-size: 0.72rem;
  }
}


/* ==========================================================================
   MOBİL DÜZELTMELER: sayfalara satır içi (inline) yazılmış çok sütunlu
   gridler küçük ekranda tek sütuna iner, taşma engellenir.
   ========================================================================== */
@media (max-width: 900px) {
  [style*="grid-template-columns: 1.4fr 0.6fr"],
  [style*="grid-template-columns: 1.35fr 0.65fr"],
  [style*="grid-template-columns: 1.25fr 0.75fr"],
  [style*="grid-template-columns: 1.2fr 0.8fr"],
  [style*="grid-template-columns: 1fr 1.2fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.75rem !important;
  }
}

@media (max-width: 768px) {
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="minmax(330px"],
  [style*="minmax(320px"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  [style*="display: grid"] > *,
  [style*="display:grid"] > * { min-width: 0; }

  /* Sayfa içi sağ sütun kartları sabit genişlikte kalmasın */
  .card, .card-gradient-border { max-width: 100%; }

  /* Satır içi büyük başlıklar mobilde ölçeklensin */
  h2.section-title,
  .section-title { font-size: clamp(1.45rem, 6vw, 1.85rem) !important; line-height: 1.2; }
}

@media (max-width: 768px) {
  .page-title { font-size: clamp(1.6rem, 7.2vw, 2rem); line-height: 1.2; }
  .page-subtitle { font-size: 1rem; }
  .page-hero { padding: 2.25rem 0 2.5rem 0; }
}

@media (max-width: 768px) {
  .page-hero h1[style*="font-size: 2.6rem"] { font-size: clamp(1.6rem, 7.2vw, 2rem) !important; line-height: 1.2; }
}

/* ==========================================================================
   MOBİL: yazı ölçeği, kompakt başlık, çekmece menü, istatistik şeridi
   ========================================================================== */
@media (max-width: 768px) {
  html { font-size: 15px; }

  /* Kompakt üst çubuk */
  .navbar { padding: 0.45rem 1rem; }
  .logo-img { height: 38px; }
  .nav-actions { gap: 0.4rem; }
  .nav-actions .btn-sm { padding: 0.45rem 0.7rem; font-size: 0.8rem; white-space: nowrap; }
  .nav-register { display: none; }
  .nav-actions .nav-call,
  .nav-actions .nav-wa { width: 38px; height: 38px; padding: 0; justify-content: center; gap: 0; }
  .nav-actions .nav-call span,
  .nav-actions .nav-wa span { display: none; }
  .nav-actions .nav-call i,
  .nav-actions .nav-wa i { font-size: 1.1rem; }
  .nav-actions { flex-shrink: 0; }
  .nav-actions > * { flex-shrink: 0; }
  .mobile-toggle { width: 40px; height: 40px; }

  /* Çekmece menü: üst çubuğun altında açılır, aydınlık tema, akordeon alt menü */
  .nav-menu {
    top: var(--hdr, 64px) !important;
    bottom: 0;
    height: auto !important;
    background: #ffffff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 0.25rem 1rem 2rem 1rem !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 14px 28px rgba(32, 0, 72, 0.14);
    transform: translateY(-12px);
  }
  .nav-menu.open { transform: none; }
  .nav-menu .nav-item { width: 100%; border-bottom: 1px solid var(--border-subtle); }
  .nav-menu .nav-link {
    width: 100% !important;
    justify-content: space-between;
    text-align: left !important;
    color: var(--text-main) !important;
    font-size: 1rem !important;
    padding: 0.85rem 0.25rem !important;
    border-radius: 0 !important;
    white-space: normal;
    background: none !important;
  }
  .nav-menu .nav-link.active,
  .nav-menu .nav-link:hover { color: var(--brand-purple) !important; }
  .nav-menu .nav-link i.fa-chevron-down { transition: transform 0.2s ease; }
  .nav-item.is-open > .nav-link i.fa-chevron-down { transform: rotate(180deg); }
  .nav-menu .dropdown-menu {
    display: none !important;
    position: static !important;
    min-width: 0 !important;
    margin: 0 0 0.6rem 0 !important;
    padding: 0.2rem 0 0.2rem 0.5rem !important;
    background: var(--bg-tint) !important;
    border: 0 !important;
    border-left: 3px solid var(--brand-purple) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  .nav-item.is-open > .dropdown-menu { display: block !important; }
  .nav-menu .dropdown-item {
    color: var(--text-main) !important;
    text-align: left !important;
    font-size: 0.92rem !important;
    padding: 0.65rem 0.5rem !important;
    white-space: normal;
    border: 0 !important;
    background: none !important;
  }
  .nav-menu .dropdown-item:hover { color: var(--brand-purple) !important; padding-left: 0.5rem !important; }

  /* İstatistik şeridi taşmasın */
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.5rem; }
  .stat-card { padding: 0.25rem 0.9rem !important; min-width: 0; }
  .stat-card:nth-child(odd) { border-left: 0; padding-left: 0 !important; }
  .stat-card-number { font-size: clamp(1.6rem, 8.5vw, 2.1rem); }
  .stat-card-icon { width: 34px; height: 34px; margin-bottom: 0.6rem; }
  .stat-card-label { font-size: 0.82rem; }
}

@media (max-width: 380px) {
  html { font-size: 14.5px; }
}

/* Üst çubuk: ara / WhatsApp / Online Kayıt dar masaüstünde taşmasın */
.nav-actions .nav-call,
.nav-actions .nav-wa { white-space: nowrap; }
@media (min-width: 1025px) and (max-width: 1440px) {
  .nav-actions { gap: 0.4rem; }
  .nav-actions .nav-wa { width: 38px; height: 38px; padding: 0; justify-content: center; gap: 0; }
  .nav-actions .nav-wa span { display: none; }
  .nav-register { padding: 0.4rem 0.3rem; font-size: 0.8rem; }
}

/* Mobil: duyuru şeridi ve atış görseli */
@media (max-width: 768px) {
  .news-ticker .ticker-wrapper { align-items: flex-start; text-align: left; gap: 0.5rem; }
  .news-ticker .ticker-content span { font-size: 0.85rem; }
  .section-img-wrapper img { height: auto; aspect-ratio: 4 / 3; object-position: 50% 35%; }
  .section-img-wrapper:hover { transform: none; }
}

/* Mobil: simülatör kartı — seçenekler 2x2, küçük yazı */
@media (max-width: 768px) {
  .exam-simulator-cta-card { padding: 1.25rem 1.1rem; }
  .exam-cta-content { flex-direction: column; align-items: stretch; gap: 1.1rem; }
  .exam-cta-text h2 { font-size: 1.2rem; }
  .exam-cta-text p { font-size: 0.86rem; }
  .exam-cta-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; width: 100%; }
  .exam-cta-actions .btn {
    width: 100%; min-width: 0; padding: 0.6rem 0.4rem; font-size: 0.78rem; line-height: 1.25;
    flex-direction: column; gap: 0.25rem; text-align: center; justify-content: center;
  }
  .exam-cta-actions .btn i { font-size: 1rem; }

  /* Sınav tarihleri tablosu: kart görünümü, yana kaydırma yok */
  .custom-table--cards, .custom-table--cards tbody { display: block; width: 100%; }
  .custom-table--cards thead { display: none; }
  .custom-table--cards tr { display: block; margin-bottom: 0.75rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
  .custom-table--cards td { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0 !important; border: 0 !important; font-size: 0.85rem; text-align: right; }
  .custom-table--cards td:first-child { display: block; text-align: left; font-size: 0.92rem; padding-bottom: 0.45rem !important; }
  .custom-table--cards td:nth-child(2)::before { content: "Sınav tarihi"; }
  .custom-table--cards td:nth-child(3)::before { content: "Eğitim bitişi"; }
  .custom-table--cards td:nth-child(4)::before { content: "Kayıt durumu"; }
  .custom-table--cards td:nth-child(5)::before { content: "İşlem"; }
  .custom-table--cards td::before { color: var(--text-muted); font-weight: 600; text-align: left; flex-shrink: 0; }
  .custom-table--cards td:first-child::before { content: none; }
  .custom-table--cards td:nth-child(5):has(> :only-child:not(a)) { display: none; }
  .custom-table--cards .course-badge-top { font-size: 0.72rem; text-align: center; }
}
@media (max-width: 768px) {
  .exam-cta-actions { align-items: stretch; }
  .exam-cta-actions .btn { height: 100%; }
}

@media (max-width: 768px) {
  .category-filter-bar .cat-btn { padding: 0.5rem 0.9rem; font-size: 0.82rem; }
  .video-card .video-title { font-size: 1.02rem; }
  .video-card .video-desc { font-size: 0.86rem; }
}

@media (max-width: 768px) {
  .category-filter-bar .cat-btn { padding: 0.5rem 0.9rem; font-size: 0.82rem; }
  .video-card .video-title { font-size: 1.02rem; }
  .video-card .video-desc { font-size: 0.86rem; }
}
