/* ============================================================
   1. GLOBAL & ORTAK YARDIMCILAR
   ============================================================ */
/* Görünürlük Sınıfları */
.desktop-view, .desktop-area { display: block; }
.mobile-app-view, .mobile-area { display: none; }

@media (max-width: 991.98px) {
    .desktop-view, .desktop-area { display: none !important; }
    .mobile-app-view, .mobile-area { display: block !important; }
    
    body { background-color: #f4f7f6; }
    .site-content { padding: 0 !important; margin: 0 !important; }
    .container-fluid, .container { padding: 0; }
}

/* ============================================================
   2. DETAY SAYFASI (Detail Page - App Style)
   ============================================================ */
@media (max-width: 991.98px) {
    /* Hero Alanı */
    .app-hero {
        position: relative;
        background: linear-gradient(135deg, #4ca1af, #2c3e50);
        color: #fff;
        padding: 40px 20px 80px 20px;
        border-bottom-left-radius: 30px;
        border-bottom-right-radius: 30px;
        text-align: center;
    }
    .hero-logo-img {
        background: #fff;
        padding: 15px;
        border-radius: 12px;
        max-height: 100px;
        max-width: 80%;
        width: auto;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        transition: transform 0.2s;
    }
    .click-hint {
        display: block; margin-top: 10px;
        font-size: 0.8rem; color: rgba(255,255,255,0.9);
        font-weight: 600; text-transform: uppercase;
    }

    /* Yüzen Kart */
    .app-card {
        background: #fff;
        margin: -60px 15px 30px 15px;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        padding: 0; overflow: hidden; position: relative; z-index: 10;
    }
    .card-header-area {
        text-align: center;
        padding: 25px 20px 15px 20px;
        border-bottom: 1px solid #f1f1f1;
    }
    .card-title {
        font-size: 1.4rem; font-weight: 800; color: #2c3e50;
        line-height: 1.3; margin-bottom: 5px;
    }
    .card-subtitle {
        font-family: 'Hanzala', sans-serif; font-size: 1.1rem;
        color: #7f8c8d; display: block;
    }

    /* Veri Listesi */
    .data-row {
        display: flex; padding: 15px 20px;
        border-bottom: 1px solid #f1f1f1; align-items: flex-start;
    }
    .data-row:last-child { border-bottom: none; }
    .data-row:nth-child(even) { background-color: #fafafa; } 
    .data-label {
        flex: 0 0 35%; font-size: 0.85rem; color: #7f8c8d;
        font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding-right: 10px;
    }
    .data-value {
        flex: 1; font-size: 0.95rem; color: #2c3e50; font-weight: 500; word-break: break-word;
    }

    /* Diğer Nüshalar */
    .other-editions-wrapper { margin: 0 15px 30px 15px; }
    .oe-header {
        font-size: 1.1rem; font-weight: 700; color: #34495e;
        margin-bottom: 15px; padding-left: 5px;
        display: flex; justify-content: space-between; align-items: center;
    }
    .oe-card {
        background: #fff; padding: 15px; border-radius: 15px;
        margin-bottom: 10px; display: flex; align-items: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.03); text-decoration: none;
    }
    .oe-icon {
        width: 35px; height: 35px; background: #ebf8ff; color: #4ca1af;
        border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 15px;
    }
    .oe-title { font-size: 0.9rem; font-weight: 600; color: #2c3e50; }
    
    .action-area { padding: 15px; background: #fff; text-align: center; border-top: 1px solid #eee; }
}

/* Masaüstü Kart Helperları */
.icon-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.icon-circle-sm { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background-color: #ebf8ff; color: #4ca1af; }
.modern-copy-card { display: block; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); border-radius: 12px; }
.modern-copy-card:hover { text-decoration: none; }
.modern-copy-card:hover .shadow-sm { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important; }
.modern-copy-card:hover .arrow-icon { color: #4ca1af !important; transform: translateX(3px); transition: transform 0.2s; }


/* ============================================================
   3. KÜTÜPHANELER & LİSTELEME SAYFALARI (Library & Listing)
   ============================================================ */
/* Mobilde ve Tablette (992px altı) */
@media (max-width: 991.98px) {
    .responsive-container {
        margin-right: 0 !important;
        padding-right: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .logo-container {
        text-align: center !important;
        margin-bottom: 20px;
    }
}
@media (min-width: 992px) {
    .responsive-container {
        margin-right: 3rem !important;
        padding-right: 3rem !important;
    }
}

/* Mobil Kart Tasarımı */
.mobile-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}
.m-header {
    background: linear-gradient(135deg, #4ca1af 0%, #2c3e50 100%);
    padding: 15px 20px;
}
.m-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
}
.m-country {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
}
.m-body { padding: 20px; }
.m-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}
.m-stat-item {
    flex: 1;
    text-align: center;
    background: #f8f9fa;
    padding: 10px 5px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.m-stat-val {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    color: #2c3e50;
}
.m-stat-label {
    font-size: 0.7rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
}
.m-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #eef2f3;
    color: #2c3e50;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}
.m-btn:hover { background: #2c3e50; color: #fff; }

/* Arama Kutusu */
.mobile-search-wrapper {
    position: relative;
    margin-bottom: 20px;
}
.mobile-search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}
.mobile-search-input:focus {
    border-color: #4ca1af;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.1);
}
.mobile-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

/* ============================================================
   4. DETAYLI ARAMA SAYFASI
   ============================================================ */
.search-block-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.search-title {
    color: #4ca1af;
    font-weight: 600;
    font-style: italic;
}
.form-control-lg, .form-select-lg {
    height: 50px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
}
.form-group {
    display: flex;
    align-items: stretch;
}
.form-group .form-control, .form-group .form-select { flex: 1; }
.btn-primary {
    background-color: #4ca1af;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: #1d3f7a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.btn-secondary {
    background-color: #6c757d;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.search-links a { color: #4ca1af; font-weight: 500; }
.search-links a:hover { color: #1d3f7a; }
.table { border-radius: 8px; overflow: hidden; }
.table th { font-weight: 600; color: #333; }
.btn-danger { border-radius: 6px; }
.row.g-2 > div { display: flex; align-items: stretch; }
#filter-rows-container { overflow-x: auto; }

@media (max-width: 768px) {
    .search-box-wrapper { padding: 20px 15px !important; }
    .search-title { font-size: 18px; }
    .search-links { gap: 2rem !important; }
    #filters-table thead { display: none; }
    #filters-table tbody tr {
        display: block; margin-bottom: 1rem; border: 1px solid #e0e0e0;
        border-radius: 8px; background-color: #fff;
    }
    #filters-table tbody td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 0.5rem 1rem; text-align: left !important; border: none; font-size: 14px;
    }
    #filters-table tbody td::before {
        content: attr(data-label); font-weight: 600; color: #555; margin-right: 1rem;
    }
    #filters-table tbody td:last-child { justify-content: flex-end; }
}

/* ============================================================
   5. ARAMA SONUÇLARI SAYFASI (Search Results)
   ============================================================ */
.filter-bar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.filter-result {
    padding-top: 8px;
}
.filter-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.filter-controls .control-item {
    padding-left: 10px;
}
.filter-controls .btn {
    padding: 14px 13px;
    border: 1px solid #f4f4f4;
}

/* Pagination */
.navigation.pagination.text-center {
    margin: 30px 0;
    padding: 20px 0;
}
.navigation.pagination .nav-links {
    display: flex; justify-content: center; align-items: center;
}
.pagination-wrapper {
    display: flex; align-items: center; gap: 0;
    background: #fff; border: 1px solid #ddd;
    border-radius: 4px; overflow: hidden;
}
.page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 6px 8px; margin: 0;
    font-size: 14px; font-weight: 400; color: #666; background-color: #fff;
    border: none; border-right: 1px solid #ddd; text-decoration: none;
    transition: all 0.2s ease; cursor: pointer;
}
.page-numbers:last-child { border-right: none; }
.page-numbers:hover { color: #333; background-color: #f8f9fa; text-decoration: none; }
.page-numbers.current { color: #007cba; background-color: #fff; font-weight: 500; cursor: default; }
.page-numbers.current:hover { color: #007cba; background-color: #fff; }
.page-numbers.prev, .page-numbers.next, 
.page-numbers.prev-single, .page-numbers.next-single { font-size: 14px; font-weight: 400; }
.page-numbers.disabled { color: #ccc; background-color: #f8f9fa; cursor: not-allowed; }
.page-numbers.dots { background-color: #fff; color: #666; cursor: default; font-weight: normal; min-width: 20px; }

/* Search Criteria Display */
.search-criteria-display {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}
.search-criteria-display:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.criteria-list { line-height: 1.6; }
.criterion-item {
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

/* Responsive Search Page */
@media (max-width: 768px) {
    .page-numbers { min-width: 28px; height: 28px; padding: 4px 6px; font-size: 13px; }
    .filter-bar-wrapper, .filter-controls { justify-content: center; }
    .filter-result { width: 100%; text-align: center; margin-bottom: 10px; }
    
    .search-criteria-display { 
        padding: 15px !important; 
        margin-bottom: 15px !important; 
    }
    .search-criteria-display h4 { 
        font-size: 14px !important; 
        margin-bottom: 10px !important; 
    }
    
    /* Kriter öğeleri için responsive düzenlemeler */
    .criterion-item {
        font-size: 12px !important; 
        padding: 8px 30px 8px 10px !important;
        margin: 5px 0 !important; 
        display: block !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        position: relative !important;
        border-radius: 15px !important;
        line-height: 1.4 !important;
    }
    
    /* İç span'lar için düzenlemeler */
    .criterion-item span { 
        display: inline-block; 
        margin-top: 4px;
        word-break: break-word;
        max-width: 100%;
    }
    
    /* Silme butonu pozisyonu */
    .criterion-item a {
        position: absolute !important;
        right: 6px !important;
        top: 8px !important;
        transform: none !important;
        font-size: 18px !important;
        padding: 4px 8px !important;
    }
    
    /* Butonlar için responsive düzenlemeler */
    .search-criteria-display .btn {
        display: block !important;
        width: 100% !important;
        margin: 8px 0 !important;
        padding: 12px !important;
        text-align: center !important;
    }
    
    .search-criteria-display .btn:first-of-type {
        margin-right: 0 !important;
    }
}
@media (max-width: 480px) {
    .navigation.pagination.text-center { margin: 20px 0; padding: 15px 0; }
    .page-numbers { min-width: 24px; height: 24px; padding: 2px 4px; font-size: 12px; }
    .page-numbers.dots { display: none; }
}


/* ============================================================
   6. DETAYLI ARAMA MOBİL DÜZELTMELERİ (Data Eklendikten Sonra)
   ============================================================ */

@media (max-width: 991.98px) {
    
    /* 1. Ana Kutu Boşluklarını Küçült */
    /* Blade dosyasındaki inline 'padding: 4rem' değerini ezer */
    .search-block-container .filter-box {
        padding: 1.5rem !important; 
    }

    /* 2. Tabloyu Tamamen Kart Görünümüne Çevir */
    #filters-table, 
    #filters-table tbody, 
    #filters-table tr, 
    #filters-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Tablo başlığını mobilde gizle */
    #filters-table thead {
        display: none !important;
    }

    /* Her bir satırı (Data Row) bir "Kart" gibi göster */
    #filters-table tbody tr {
        margin-bottom: 15px;
        background-color: #fff;
        border: 1px solid #e1e8ed;
        border-radius: 12px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03);
        overflow: hidden; /* Köşeler düzgün görünsün */
    }

    /* Hücreleri (TD) Flex Satırlara Çevir */
    #filters-table tbody td {
        display: flex !important;
        justify-content: space-between; /* Etiket sola, değer sağa */
        align-items: center;
        padding: 12px 15px !important;
        border-bottom: 1px solid #f1f1f1;
        text-align: right !important; /* JS'den gelen center'ı ez */
        min-height: 50px;
    }

    #filters-table tbody td:last-child {
        border-bottom: none; /* Son çizgi kalksın */
        background-color: #f8f9fa; /* Aksiyon alanı hafif gri olsun */
        justify-content: center; /* Butonu ortala */
    }

    /* "data-label" özniteliğini kullanarak başlıkları göster */
    #filters-table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
        font-size: 0.85rem;
        color: #7f8c8d;
        text-transform: uppercase;
        margin-right: auto; /* Sağa yaslanan içerikten uzaklaştır */
    }

    /* 3. İçerik Düzenlemeleri */
    
    /* Operatör Seçimi (Select Box) Düzeni */
    #filters-table tbody td select {
        width: auto !important;
        max-width: 150px;
        margin: 0 !important; /* JS marginini sıfırla */
        display: inline-block;
    }

    /* Silme Butonu Düzeni */
    #filters-table .remove-filter-btn {
        width: 100%; /* Mobilde butona basmak kolay olsun */
        padding: 10px !important;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    /* Aksiyon kısmındaki label'ı gizle (Gereksiz yer kaplamasın) */
    #filters-table tbody td:last-child::before {
        display: none; 
    }
    
    /* 4. Form Alanları İyileştirmesi */
    /* Select ve Input alanlarının mobildeki yüksekliği */
    .form-group .form-control-lg, 
    .form-group .form-select-lg {
        font-size: 14px;
        height: 45px;
    }
    
    /* Butonlar mobilde alt alta */
    .search-filters .d-flex.justify-content-end {
        flex-direction: column-reverse;
        gap: 10px !important;
    }
    
    .search-filters .d-flex.justify-content-end button {
        width: 100%;
        margin: 0 !important;
    }
}

