/*================================================================================
    IRO - Responsive & Mobile Optimization CSS
    Tüm mobil ve tablet cihazlar için responsive düzenlemeler
================================================================================*/

/* ============================================================
   1. GENEL MOBİL İYİLEŞTİRMELER
   ============================================================ */

/* Touch-friendly minimum hedefler (48px Apple/Google HIG standardı) */
@media (max-width: 767.98px) {

    /* Touch hedef boyutları */
    .btn,
    .nav-link,
    .dropdown-item,
    .form-control,
    .custom-select,
    .breadcrumb-item a {
        min-height: 44px;
        line-height: 1.5;
    }

    .btn-xs {
        min-height: 38px;
        min-width: 38px;
        padding: 6px 10px;
    }

    /* Genel sayfa padding düzenlemesi */
    .app-content {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .app-content .content-wrapper {
        padding: 0.5rem 0 !important;
    }

    /* Kart bileşenleri */
    .card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .card-body {
        padding: 0.75rem !important;
    }

    .card-header {
        padding: 0.75rem !important;
    }

    .card-header h4.card-title {
        font-size: 1rem;
    }

    /* Heading elements mobilde ikona dönüşme */
    .heading-elements {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        text-align: center;
        padding-top: 0.5rem;
    }
}

/* ============================================================
   2. NAVİGASYON - MOBİL MENÜ İYİLEŞTİRMELERİ
   ============================================================ */

@media (max-width: 767.98px) {

    /* Header navbar mobil düzeni */
    .header-navbar .navbar-header {
        padding: 0 0.5rem;
    }

    .header-navbar .navbar-brand img {
        max-height: 40px;
        width: auto !important;
        height: auto !important;
    }

    /* Mobil menü toggle butonu */
    .nav-item.mobile-menu a,
    .nav-item .open-navbar-container {
        padding: 10px 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-item.mobile-menu .ft-menu {
        font-size: 1.5rem;
    }

    /* Navbar collapse mobil düzen */
    #navbar-mobile {
        background-color: #fff;
        border-top: 1px solid #e4e7ed;
        padding: 0.5rem;
    }

    #navbar-mobile .nav.navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    #navbar-mobile .nav.navbar-nav.float-right {
        float: none !important;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    /* Kullanıcı dropdown mobilde tam genişlik */
    .dropdown-user .dropdown-toggle {
        padding: 8px 12px;
    }

    .dropdown-user .dropdown-menu {
        width: 100%;
        position: static !important;
        transform: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    /* Horizontal menu mobil düzeni */
    .navbar-horizontal {
        position: relative;
    }

    .navbar-horizontal .navbar-container {
        padding: 0 !important;
    }

    .navbar-horizontal #main-menu-navigation {
        flex-direction: column;
        width: 100%;
        padding: 0.5rem;
    }

    .navbar-horizontal #main-menu-navigation > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-horizontal #main-menu-navigation > li:last-child {
        border-bottom: none;
    }

    .navbar-horizontal #main-menu-navigation > li > a {
        padding: 12px 15px;
        display: flex;
        align-items: center;
        font-size: 0.95rem;
    }

    .navbar-horizontal #main-menu-navigation > li > a > i {
        margin-right: 10px;
        font-size: 1.1rem;
        width: 24px;
        text-align: center;
    }

    .navbar-horizontal #main-menu-navigation > li > a > span {
        flex: 1;
    }

    /* Dropdown menü mobil düzeni */
    .navbar-horizontal .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        border: none;
        box-shadow: none;
        background-color: #f8f9fa;
        padding-left: 1rem;
        margin: 0;
    }

    .navbar-horizontal .dropdown-menu .dropdown-item {
        padding: 10px 15px;
        font-size: 0.9rem;
        white-space: normal;
        word-wrap: break-word;
    }

    /* Alt menü (submenu) mobil düzeni */
    .navbar-horizontal .dropdown-menu .dropdown-menu {
        padding-left: 1rem;
        background-color: #f0f1f3;
    }

    /* Badge'ler mobilde alt satıra */
    .navbar-horizontal .badge {
        display: inline-block;
        margin: 2px 2px;
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    /* Menü açık/kapalı geçişleri */
    .navbar-horizontal .dropdown.show > .dropdown-menu {
        display: block;
    }
}

/* ============================================================
   3. TABLOLAR - MOBİL RESPONSIVE
   ============================================================ */

@media (max-width: 991.98px) {

    /* Tablo container otomatik kaydırma */
    .table-responsive-wrapper,
    .card-body .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: -ms-autohiding-scrollbar;
    }

    /* DataTables wrapper */
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper table {
        min-width: 700px;
    }
}

@media (max-width: 767.98px) {

    /* Tablo hücreleri daha kompakt */
    table.dataTable th {
        font-size: 0.8rem !important;
        padding: 4px 6px !important;
        white-space: nowrap;
    }

    table.dataTable td {
        font-size: 0.8rem !important;
        padding: 4px 6px !important;
    }

    /* Tablo aksiyon butonları */
    table .btn-xs {
        padding: 4px 8px;
        margin: 2px 1px;
    }

    /* DataTables filtreleme/sayfalama */
    .dataTables_length,
    .dataTables_filter {
        text-align: center !important;
        float: none !important;
        margin-bottom: 0.5rem;
    }

    .dataTables_filter input {
        width: 100% !important;
        max-width: 300px;
        margin: 0.25rem auto;
    }

    .dataTables_info,
    .dataTables_paginate {
        text-align: center !important;
        float: none !important;
        margin-top: 0.5rem;
    }

    .dataTables_paginate .paginate_button {
        padding: 6px 10px !important;
        min-width: 36px;
    }

    /* Tablo export butonları */
    .buttons-html5,
    .buttons-print,
    .buttons-copy,
    .buttons-csv,
    .buttons-excel,
    .buttons-pdf {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
        margin: 2px !important;
    }
}

/* ============================================================
   4. FORMLAR - MOBİL RESPONSIVE
   ============================================================ */

@media (max-width: 767.98px) {

    /* Form kontrolleri */
    .form-control,
    .custom-select {
        font-size: 16px !important; /* iOS zoom engelleme */
        padding: 8px 12px;
    }

    /* Form grupları */
    .form-group {
        margin-bottom: 0.75rem;
    }

    /* Form satırları */
    .form-group .row > [class*="col-md-"],
    .form-group .row > [class*="col-lg-"] {
        margin-bottom: 0.5rem;
    }

    /* Fieldset düzeni */
    fieldset {
        padding: 0.5rem;
    }

    /* Radio ve checkbox touch-friendly */
    .form-check,
    .custom-control {
        padding: 8px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .form-check-label,
    .custom-control-label {
        padding-left: 8px;
        line-height: 1.5;
    }

    /* Float:left radio butonları düzeltme */
    [style*="float:left"],
    [style*="float: left"] {
        float: none !important;
        display: block;
        width: 100%;
    }

    /* Form doğrulama mesajları */
    .validate-message {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Select2 dropdown mobil uyum */
    .select2-container {
        width: 100% !important;
    }

    .select2-container .select2-selection {
        min-height: 44px;
        padding: 6px 8px;
    }

    /* İnput grupları */
    .input-group {
        flex-wrap: wrap;
    }

    .input-group > .form-control {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ============================================================
   5. STEP FORM (BAŞVURU ADIM FORMU) - MOBİL
   ============================================================ */

@media (max-width: 767.98px) {

    /* Step menü tab */
    .steps-validation .steps ul {
        flex-direction: column;
    }

    .steps-validation .steps ul li {
        width: 100%;
        margin-bottom: 2px;
    }

    .steps-validation .steps ul li a {
        padding: 10px;
        font-size: 0.85rem;
        text-align: left;
    }

    /* Step form içerik */
    .steps-validation .content {
        padding: 0.5rem !important;
    }

    /* Step form butonları */
    .steps-validation .actions ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .steps-validation .actions ul li {
        flex: 1;
        min-width: 120px;
    }

    .steps-validation .actions ul li a {
        display: block;
        text-align: center;
        padding: 10px;
    }

    /* Form row'ları mobilde stack */
    .steps-validation .row > [class*="col-md-3"],
    .steps-validation .row > [class*="col-md-4"],
    .steps-validation .row > [class*="col-md-6"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ============================================================
   6. PROFİL SAYFASI - MOBİL
   ============================================================ */

@media (max-width: 767.98px) {

    /* Profil fotoğrafı responsive */
    .profile-photo-container img,
    img[style*="max-height:200px"],
    img[style*="min-height:200px"] {
        max-width: 150px !important;
        min-width: auto !important;
        max-height: 150px !important;
        min-height: auto !important;
        width: auto !important;
        height: auto !important;
        margin: 0 auto;
        display: block;
    }

    /* Profil üst padding düzeltme */
    [style*="padding-top: 11rem"] {
        padding-top: 2rem !important;
    }
}

/* ============================================================
   7. LOGIN / SIGNUP SAYFALARI - MOBİL
   ============================================================ */

@media (max-width: 767.98px) {

    /* Login/Signup kartı tam genişlik */
    .flexbox-container .col-md-4.col-10 {
        flex: 0 0 95%;
        max-width: 95%;
    }

    /* Logo responsive */
    .flexbox-container .card-title img {
        max-width: 100%;
        height: auto !important;
        width: auto !important;
    }

    /* Butonlar tam genişlik */
    .flexbox-container .btn-block {
        padding: 12px;
        font-size: 1rem;
    }

    /* Arka plan resmi mobilde optimize */
    .bg-login-full-screen-image {
        background-attachment: scroll !important;
    }
}

/* ============================================================
   8. FOOTER - MOBİL
   ============================================================ */

@media (max-width: 767.98px) {

    .footer p {
        flex-direction: column;
        text-align: center !important;
    }

    .footer .float-md-left,
    .footer .float-md-right {
        float: none !important;
        display: block;
        text-align: center;
        margin-bottom: 0.25rem;
    }

    .footer .float-md-right {
        font-size: 0.8rem;
    }
}

/* ============================================================
   9. BREADCRUMB - MOBİL
   ============================================================ */

@media (max-width: 767.98px) {

    .content-header .breadcrumb {
        padding: 0.5rem 0;
        font-size: 0.85rem;
    }

    .content-header .btn-group {
        float: none !important;
        display: flex;
        justify-content: flex-start;
        margin-bottom: 0.5rem;
    }

    .content-header .btn-group .btn {
        flex: 0 1 auto;
    }

    .content-header-right {
        margin-bottom: 0.5rem;
    }
}

/* ============================================================
   10. MODAL DİALOGLARI - MOBİL
   ============================================================ */

@media (max-width: 767.98px) {

    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem) !important;
    }

    .modal-body {
        padding: 1rem;
        max-height: 70vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-footer {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
    }
}

/* ============================================================
   11. GENEL GÖRSEL İYİLEŞTİRMELER
   ============================================================ */

/* Tüm görseller responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Carousel görselleri mobilde */
@media (max-width: 767.98px) {

    .carousel .img-responsive-campuses {
        min-height: 200px !important;
        max-height: 250px !important;
    }

    .updateFromCampuses,
    .updateFromPlaces {
        max-height: 120px;
        min-height: 120px;
    }

    .img-330px-max-min {
        max-height: 200px !important;
        min-height: 180px !important;
    }
}

/* ============================================================
   12. SweetAlert & Toastr MOBİL
   ============================================================ */

@media (max-width: 767.98px) {

    .swal-modal {
        width: calc(100% - 2rem) !important;
        max-width: 320px;
    }

    .toast-top-right {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    #toast-container > .toast {
        width: 100% !important;
        max-width: none;
    }
}

/* ============================================================
   13. TABLET BREAKPOINT (768px - 991px)
   ============================================================ */

@media (min-width: 768px) and (max-width: 991.98px) {

    /* Tablet için 2 sütun grid */
    .steps-validation .row > [class*="col-md-3"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Navbar düzeni */
    .navbar-horizontal #main-menu-navigation > li > a {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .navbar-horizontal #main-menu-navigation > li > a > span {
        font-size: 0.85rem !important;
    }

    /* Badge küçültme */
    .navbar-horizontal .badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }

    /* Kart içerikleri */
    .card-body {
        padding: 1rem;
    }
}

/* ============================================================
   14. KÜÇÜK MOBİL (< 400px)
   ============================================================ */

@media (max-width: 399.98px) {

    /* En küçük ekranlar */
    .app-content {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .card-body {
        padding: 0.5rem !important;
    }

    .btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .navbar-horizontal #main-menu-navigation > li > a {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Tablo minimum genişlik küçült */
    .dataTables_wrapper table {
        min-width: 500px;
    }

    /* Footer font küçültme */
    .footer p {
        font-size: 0.75rem;
    }
}

/* ============================================================
   15. PWA & STANDALone MOBİL UYGULAMA DESTEĞİ
   ============================================================ */

/* iOS safe area desteği (notch) */
@supports (padding: env(safe-area-inset-top)) {
    .header-navbar {
        padding-top: env(safe-area-inset-top);
    }

    .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .app-content {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }
}

/* Standalone modda (homescreen) - URL bar gizleniyor */
@media all and (display-mode: standalone) {
    .header-navbar {
        padding-top: env(safe-area-inset-top, 0);
    }
}

/* ============================================================
   16. DOKUNMATIK İYİLEŞTİRMELER
   ============================================================ */

/* Scroll performansı */
.table-responsive,
.card-body,
.modal-body,
.dataTables_wrapper {
    -webkit-overflow-scrolling: touch;
}

/* Tap highlight temizleme */
a, button, .btn, .nav-link, .dropdown-item {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Hover efektlerini mobilde kaldır */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        opacity: 1;
    }

    .dropdown-item:hover {
        background-color: transparent;
    }

    .nav-link:hover {
        color: inherit;
    }
}

/* ============================================================
   17. YAZDIR (PRINT) OPTİMİZASYONU
   ============================================================ */

@media print {
    .header-navbar,
    .navbar-horizontal,
    .footer,
    .heading-elements,
    .btn-group,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_paginate,
    .dataTables_info {
        display: none !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    table {
        font-size: 10pt;
    }
}

/* ============================================================
   18. LANDSCAPE MODU İYİLEŞTİRMELERİ
   ============================================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .header-navbar {
        padding: 0.25rem 0;
    }

    .navbar-horizontal {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .card-body {
        padding: 0.5rem;
    }

    .footer {
        padding: 0.25rem;
    }
}

/* ============================================================
   19. ERIŞILEBILIRLIK (ACCESSIBILITY)
   ============================================================ */

/* Focus göstergeleri (klavye navigasyonu) */
*:focus-visible {
    outline: 2px solid #666EE8;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Hareket engelli kullanıcılar için animasyon azaltma */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Yüksek kontrast modu desteği */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }

    .form-control {
        border-width: 2px;
    }

    .card {
        border-width: 2px;
    }
}
