﻿/* Enhanced Operator Modal Styles - Modern Professional Design */
.operator-modal {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Prevent modal from occupying full viewport height on desktop */
    max-height: 85vh;
}

.operator-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.operator-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.operator-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.operator-list {
    gap: 8px;
}

.operator-list .operator-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    border: 2px solid transparent;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.operator-list .operator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.04), transparent);
    transition: left 0.6s ease;
}

.operator-list .operator-card:hover::before {
    left: 100%;
}

.operator-list .operator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.operator-list .operator-card.active {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
}

.operator-card-body {
    padding: 16px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.operator-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.operator-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.operator-card:hover .operator-avatar {
    transform: scale(1.05);
}

.operator-name {
    font-weight: 600;
    font-size: 15px;
    color: #2d3748;
    margin-bottom: 2px;
}

.operator-country {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.operator-price {
    text-align: right;
    min-width: 100px;
}

.operator-price .price-amount {
    font-weight: 700;
    font-size: 16px;
    color: #2d3748;
}

.operator-price .price-count {
    display: block;
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

/* List group item styles */
.operator-list .list-group-item,
.operator-list .operator-item {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    margin: 0;
    border: none;
    transition: all 0.3s ease;
}

.operator-list .operator-item {
    width: 100%;
    border: 2px solid #f7fafc;
    margin-bottom: 8px;
}

.operator-list .operator-item:last-child {
    margin-bottom: 0;
}

.operator-list .operator-item .form-check {
    margin-right: 12px;
}

.operator-list .operator-item .fw-medium {
    margin-bottom: 0;
    font-weight: 600;
    color: #2d3748;
}

.operator-list .operator-item .small {
    color: #718096;
    font-size: 12px;
}

.operator-list .operator-item .text-end {
    min-width: 110px;
    text-align: right;
}

.operator-list .operator-item.active {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
}

.operator-list .operator-item.active::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    z-index: -1;
    opacity: 0.1;
}

/* Modal body enhancements */
.operator-modal .modal-body {
    background: #f8fafc;
    padding: 1rem 1rem;
    /* Constrain body height and allow scrolling for long operator lists */
    max-height: calc(42vh);
    overflow-y: auto;
}

.operator-modal .modal-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
}

/* Loading state enhancements */
#operatorLoading {
    padding: 3rem 1rem;
}

#operatorLoading .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

/* Responsive design */
@media (max-width: 576px) {
    .operator-modal {
        margin: 1rem;
        border-radius: 12px;
    }
    
    .operator-modal-header {
        padding: 1.25rem;
    }
    
    .operator-card-body {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .operator-meta {
        width: 100%;
    }
    
    .operator-price {
        text-align: left;
        min-width: auto;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .operator-list .operator-item {
        margin-bottom: 6px;
    }
    
    .operator-modal .modal-body {
        padding: 1rem;
    }
    
    .operator-modal .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .operator-modal .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* Animation for modal appearance */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal.show .modal-dialog {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar for modal */
.operator-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.operator-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.operator-modal .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.operator-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Selection indicator */
.operator-item .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.operator-item .form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.15em;
}

/* Price badge styling */
.operator-price .price-amount::before {
    content: '$';
    font-size: 0.85em;
    opacity: 0.8;
    margin-right: 1px;
}

/* Status badges */
.badge.bg-success {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #a0aec0, #718096) !important;
}

/* Hover effects for interactive elements */
.operator-list .operator-item:not(.active):hover {
    border-color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Focus states for accessibility */
.operator-list .operator-item:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading more indicator */
#operatorMoreLoading {
    padding: 1.5rem;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 0 0 12px 12px;
}

#operatorMoreLoading .spinner-border-sm {
    width: 1.2rem;
    height: 1.2rem;
}
</style>

#numbersContainer tr {
    transition: all 0.2s ease;
}

#numbersContainer tr:hover {
    background-color: rgba(58, 123, 213, 0.05);
}

/* Table header only â€” do not target .header.sticky-top (site nav) */
.virtual-num-shell thead.sticky-top {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 2;
}

.table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #3a7bd5;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #2c5fb3;
}

.card {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.table {
    font-size: 0.875rem;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

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

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.text-primary {
    color: #3a7bd5 !important;
}

.bg-primary {
    background-color: #3a7bd5 !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(58, 123, 213, 0.05);
}

.btn-outline-primary:hover {
    background-color: #3a7bd5;
    border-color: #3a7bd5;
}

@media (max-width: 992px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
}

.toast {
    transition: all 0.3s ease;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3a7bd5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2c5fb3;
}

/* Larger, slightly bolder remaining-time display to match table fonts */
.activation-remaining {
    font-size: 0.95rem; /* slightly larger than .small */
    font-weight: 600;
}

/* Inline help text responsive tweaks */
.activation-help-text {
    padding-left: 0.5rem;
}
.activation-help-text ul { margin: 0; padding-left: 1rem; }

@media (max-width: 576px) {
    .activation-help-text { padding-left: 0; font-size: 0.86rem; }
    .btn-group-sm .btn { padding: 0.2rem 0.45rem; }
}

/* Operator modal list styles */
.operator-item { transition: background-color 0.15s ease, border-color 0.15s ease; }
.operator-item.active { background-color: rgba(58,123,213,0.06); border-left: 3px solid #3a7bd5; }
/* Ensure active row text remains legible: override any inherited active colors from Bootstrap */
.operator-item.active, .operator-item.active * { color: inherit; }
.operator-item.active .fw-medium { font-size: 0.95rem; color: #0b3a66; }
.operator-item.active .small { font-size: 0.8rem; color: #6c757d; }
.operator-item .fw-medium { font-size: 0.95rem; }
.operator-item .small { font-size: 0.8rem; }

/* Mobile-specific: convert tables into stacked cards and enlarge touch targets */
    @media (max-width: 767px) {
    /* Filters toggled via .pn-vn-filters--open (proxnum-mobile.css + proxnum-ui.js) */
    #filterControls.mobile-open { display: block !important; }
    /* Ensure columns stack but keep the numbers list in compact table form (like earlier layout) */
    .row.g-4 { display: block; }
    .col-lg-3, .col-lg-9 { width: 100%; }

    /* Use compact table rows on mobile to match the old listing style
       - Keep rows as table rows (not cards)
       - Reduce vertical padding and make Buy button small and right-aligned
       - Preserve flags/logos (rendered by _renderFlag) */
    #numbersContainer tr { display: table-row; border: 0; padding: 0; margin-bottom: 0; }
    #numbersContainer td { display: table-cell; vertical-align: middle; background: transparent; border-radius: 0; box-shadow: none; padding: 10px 8px; }
    #numbersContainer td:first-child { padding-left: 4px; }
    #numbersContainer td .fw-medium { font-size: 0.95rem; }
    #numbersContainer td .text-muted.small { font-size: 0.82rem; }

    /* Keep the action column compact and right aligned */
    #numbersContainer td.text-end { width: 110px; white-space: nowrap; vertical-align: middle; }
    #numbersContainer .btn { width: auto; display: inline-block; padding: 0.38rem 0.6rem; font-size: 0.85rem; }

    /* Activation rows: keep table layout but slightly compact spacing */
    #activation_table tbody tr { display: table-row; border: 0; margin-bottom: 0; }
    #activation_table tbody tr td { display: table-cell; width: auto; padding: 8px; vertical-align: middle; background: transparent; box-shadow: none; }

    /* Slightly increase tappable area for operator items while remaining compact */
    .operator-item { padding: 10px 8px; }

    /* Make grouped small buttons stack horizontally with a small gap to match previous mobile table actions */
    .btn-group.btn-group-sm { display:flex; gap:6px; flex-direction:row; }
    .btn-group.btn-group-sm .btn { display:inline-block; margin-bottom: 0; }
}
/* Operator modal enhancements for mobile: sticky footer, scrollable body */
.modal-fullscreen-sm-down .modal-content {
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.modal-fullscreen-sm-down .modal-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}
.modal-fullscreen-sm-down .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.06);
}

@media (max-width: 767px) {
    /* Stack modal footer buttons vertically and make them large/tappable */
    #operatorModal .modal-footer { padding: 0.6rem; }
    #operatorModal .modal-footer .btn { width: 100%; font-size: 1rem; padding: 0.55rem 0.75rem; margin-bottom: 6px; }
    #operatorModal .modal-footer .btn:last-child { margin-bottom: 0; }
}
</style>
