/**
 * DataTables — sayfalama, arama ve kayıt sayısı kontrolleri (Admin Panel)
 */

div.dataTables_wrapper {
    --dt-primary: #0b3c84;
    --dt-primary-hover: #092f6a;
    --dt-muted: #64748b;
    --dt-border: #e2e8f0;
    --dt-radius: 0.5rem;
}

/* Üst araç çubuğu (kayıt sayısı + arama) */
div.dataTables_wrapper > .row:first-of-type {
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
    background: transparent;
    border: none;
}

div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter {
    padding: 0;
}

div.dataTables_wrapper div.dataTables_length label,
div.dataTables_wrapper div.dataTables_filter label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dt-muted);
}

div.dataTables_wrapper div.dataTables_length select,
div.dataTables_wrapper div.dataTables_length select.form-select {
    display: inline-block;
    width: auto;
    min-width: 4.25rem;
    padding: 0.4rem 1.75rem 0.4rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: var(--dt-radius);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    /* form-select + native ok = çift ok; tek ok kullan */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px 10px;
}

div.dataTables_wrapper div.dataTables_length select:focus,
div.dataTables_wrapper div.dataTables_length select.form-select:focus {
    border-color: var(--dt-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(11, 60, 132, 0.12);
}

div.dataTables_wrapper div.dataTables_filter {
    text-align: right;
}

div.dataTables_wrapper div.dataTables_filter label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

div.dataTables_wrapper div.dataTables_filter input[type="search"],
div.dataTables_wrapper div.dataTables_filter input {
    display: inline-block;
    width: auto;
    min-width: 11rem;
    max-width: 280px;
    margin-left: 0;
    padding: 0.5rem 2.25rem 0.5rem 0.875rem;
    font-size: 0.875rem;
    color: #334155;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--dt-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

div.dataTables_wrapper div.dataTables_filter label::after {
    content: "\f0d1";
    font-family: "remixicon";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #94a3b8;
    pointer-events: none;
}

div.dataTables_wrapper div.dataTables_filter input:focus {
    border-color: var(--dt-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(11, 60, 132, 0.12);
}

div.dataTables_wrapper div.dataTables_filter input::placeholder {
    color: #94a3b8;
}

/* Alt bilgi + sayfalama */
div.dataTables_wrapper > .row:last-of-type {
    align-items: center;
    margin-top: 0.875rem;
    padding: 0.875rem 0.25rem 0.25rem;
    border-top: 1px solid var(--dt-border);
}

div.dataTables_wrapper div.dataTables_info {
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dt-muted);
}

div.dataTables_wrapper div.dataTables_paginate {
    padding: 0;
    text-align: right;
}

div.dataTables_wrapper div.dataTables_paginate .pagination {
    margin: 0;
    gap: 0.35rem;
    justify-content: flex-end;
}

/* Bootstrap: li.paginate_button sadece sarmalayıcı — kutu stili page-link'te */
div.dataTables_wrapper div.dataTables_paginate .paginate_button.page-item {
    margin: 0 0 0 0.35rem !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    list-style: none;
}

div.dataTables_wrapper div.dataTables_paginate .paginate_button.page-item:first-child {
    margin-left: 0 !important;
}

div.dataTables_wrapper div.dataTables_paginate .page-link,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:not(.page-item) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2.125rem;
    min-height: 2.125rem;
    padding: 0.375rem 0.75rem !important;
    margin: 0 !important;
    border: 1px solid var(--dt-border) !important;
    border-radius: var(--dt-radius) !important;
    background: #fff !important;
    color: var(--dt-primary) !important;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    box-sizing: border-box;
    box-shadow: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

div.dataTables_wrapper div.dataTables_paginate .page-item:not(.active):not(.disabled) .page-link:hover,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:not(.page-item):not(.disabled):not(.current):hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: var(--dt-primary-hover) !important;
}

div.dataTables_wrapper div.dataTables_paginate .page-item.active .page-link,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:not(.page-item).current,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:not(.page-item).current:hover {
    background: var(--dt-primary) !important;
    border-color: var(--dt-primary) !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(11, 60, 132, 0.2);
}

div.dataTables_wrapper div.dataTables_paginate .page-item.disabled .page-link,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:not(.page-item).disabled,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:not(.page-item).disabled:hover {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f8fafc !important;
    border-color: var(--dt-border) !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
}

div.dataTables_wrapper div.dataTables_paginate .paginate_button.ellipsis,
div.dataTables_wrapper div.dataTables_paginate .ellipsis {
    display: inline-flex;
    align-items: center;
    min-height: 2.125rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem !important;
    color: var(--dt-muted);
    border: none !important;
    background: transparent !important;
}

/* Dışa aktarma butonları */
div.dataTables_wrapper .dt-buttons {
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

div.dataTables_wrapper .dt-buttons .dt-button {
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--dt-radius);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

div.dataTables_wrapper .dt-buttons .dt-button:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #334155;
}

/* table-card sarmalayıcısı (varsa) */
.table-card div.dataTables_wrapper > .row:first-of-type,
.card-body div.dataTables_wrapper > .row:first-of-type {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.table-card div.dataTables_wrapper > .row:last-of-type,
.card-body div.dataTables_wrapper > .row:last-of-type {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

@media (max-width: 767.98px) {
    div.dataTables_wrapper > .row:first-of-type > [class*="col-"] {
        margin-bottom: 0.5rem;
    }

    div.dataTables_wrapper div.dataTables_filter {
        text-align: left;
    }

    div.dataTables_wrapper div.dataTables_filter label {
        justify-content: flex-start;
    }

    div.dataTables_wrapper div.dataTables_filter input {
        width: 100%;
        max-width: none;
    }

    div.dataTables_wrapper div.dataTables_paginate {
        text-align: center;
        margin-top: 0.5rem;
    }

    div.dataTables_wrapper div.dataTables_paginate .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    div.dataTables_wrapper div.dataTables_info {
        text-align: center;
    }
}
