/* ===== Base ===== */
.iptv-lookup-controls {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.iptv-search-field { flex: 1 1 20rem; }
.migration-page { --bs-gutter-x: 1rem; }
.iptv-lookup-controls .btn-outline-secondary:not(:disabled),
.migration-page a.btn-outline-secondary {
    color: #adb5bd;
    border-color: #adb5bd;
}
.iptv-lookup-controls .btn-outline-secondary:not(:disabled):hover,
.migration-page a.btn-outline-secondary:hover {
    color: #212529;
    background-color: #adb5bd;
}
.iptv-identity { overflow-wrap: anywhere; min-width: 10rem; }
#table-iptv, #table-bundle { font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
    .iptv-lookup-controls > div { width: 100%; }
    .iptv-identity { min-width: 0; }
    #table-iptv .action-cell, #table-bundle .action-cell { display: table-cell; }
    #table-iptv .btn, #table-bundle .btn { white-space: normal; }
}

.table th {
    white-space: nowrap;
}

.user-row td {
    vertical-align: middle;
}

#confirm-panel {
    border: 2px solid #dc3545;
}

.badge {
    font-size: 0.75em;
}

/* Dark theme tweaks (Bootstrap data-bs-theme="dark" handles most) */
.table-success {
    --bs-table-bg: #1a3a2a;
    --bs-table-color: #dee2e6;
}
.table-warning {
    --bs-table-bg: #3a351a;
    --bs-table-color: #dee2e6;
}
.table-secondary {
    --bs-table-bg: #2a2a2a;
    --bs-table-color: #9e9e9e;
}

/* ===== Mobile-friendly styles ===== */

/* Touch-friendly buttons and links */
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Nav tabs: horizontal scroll on mobile instead of wrapping */
.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar {
    display: none;
}
.nav-tabs .nav-link {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}

/* Mobile */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar .navbar-brand {
        font-size: 1rem;
    }

    .card-body {
        padding: 0.75rem;
    }
    .card-header h5 {
        font-size: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }
    .table td, .table th {
        padding: 0.35rem 0.4rem;
    }

    .col-hide-mobile {
        display: none !important;
    }

    .info-row .col-sm-3,
    .info-row .col-sm-4 {
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .table .btn-sm {
        min-height: 36px;
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    #confirm-panel ul {
        padding-left: 1.2rem;
        font-size: 0.9rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .action-cell {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .action-cell .btn,
    .action-cell .badge {
        width: 100%;
        text-align: center;
    }

    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .form-actions .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    .form-check-input {
        width: 1.25em;
        height: 1.25em;
    }
    .form-check-label {
        padding-left: 0.25rem;
    }

    #price-summary .table td {
        font-size: 0.85rem;
    }
}

/* Tablet */
@media (max-width: 767.98px) {
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }

    .table td.small {
        font-size: 0.75rem;
    }
}
