/* Modern Group Management Styles */
.group-management-container {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.group-management-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.header-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.group-management-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.header-search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search .search-input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    box-sizing: border-box;
}

.header-search .search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
}

.header-search .search-input::placeholder {
    color: #666;
}

.header-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 12px;
}

.search-help-icon {
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.search-help-icon:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary-action {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-warning-action {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #212529;
}

.btn-danger-action {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-info-action {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-secondary-action {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.badge-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid rgba(226, 232, 240, 0.6);
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 14px;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.table-responsive {
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    position: relative;
    flex: 1;
}

/* Scroll indicator for mobile */
.table-responsive::after {
    content: "← Scroll to see more →";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #6c757d;
    opacity: 0.7;
    display: none;
}

@media (max-width: 768px) {
    .header-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-search {
        width: 100%;
    }
    
    .table-responsive::after {
        display: block;
    }
}

.table {
    margin-bottom: 0;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: 1px solid #dee2e6;
    padding: 15px 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.table tbody tr.hidden {
    display: none;
}

.table tbody td {
    padding: 15px 12px;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

/* Column width controls */
.table th:nth-child(1),
.table td:nth-child(1) {
    width: 18%;
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: 10%;
}

.table th:nth-child(3),
.table td:nth-child(3) {
    width: 15%;
}

.table th:nth-child(4),
.table td:nth-child(4) {
    width: 12%;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    width: 12%;
}

.table th:nth-child(6),
.table td:nth-child(6) {
    width: 33%;
}

.group-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 4px 0;
}

.sim-count {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.quota-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quota-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.plan-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 11px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.bundle-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bundle-badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%) !important;
    color: #212529 !important;
}

.bundle-badge.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: white !important;
}

.bundle-badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    color: white !important;
}

.no-quotas {
    color: #6c757d;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.action-btn-small {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-view-small {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-edit-small {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.btn-delete-small {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
}

.btn-quota-small {
    background: linear-gradient(135deg, #343a40 0%, #23272b 100%);
    color: white;
}

.btn-bulk-small {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-refresh-small {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-autoload-small {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-autoload-on {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
}

.btn-autoload-off {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
}

.action-btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Status Toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Inactive toggle - red color */
.toggle-slider {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    display: none;
}

.no-results.show {
    display: block;
}

.no-results-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-results h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d3748;
}

.no-results p {
    font-size: 14px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .group-management-header {
        padding: 15px;
    }

    .group-management-header h3 {
        font-size: 20px;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-btn-small {
        width: 100%;
        justify-content: center;
        border-radius: 6px;
        margin-bottom: 2px;
    }

    .search-container {
        max-width: 100%;
    }

    /* Mobile table improvements */
    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .group-name {
        font-size: 14px;
    }

    .sim-count {
        font-size: 10px;
    }
}

/* Bootbox styling */
.bootbox .form-control,
.bootbox option {
    color: #000 !important;
    background-color: #fff !important;
}

/* Dropdown menu fixes */
.dropdown-menu {
    position: absolute !important;
    z-index: 1050 !important;
    min-width: 200px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.dropdown-item {
    padding: 8px 16px !important;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 2px 8px;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    transform: translateX(4px);
}

/* Quota Modal Styles */
.remaining-quota {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.remaining-quota h4 {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.remaining-quota h2 {
    color: var(--primary);
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.quota-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.quota-item:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quota-counter {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
}

.btn-counter {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-counter:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.quota-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
    text-align: center;
}

.allocation-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.allocation-summary h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
}

.allocation-summary .row {
    margin: 0;
}

.allocation-summary .col-6 {
    padding: 0 8px;
}

.allocation-summary small {
    color: #6c757d;
    font-size: 12px;
}

.allocation-summary strong {
    color: var(--primary);
    font-weight: 700;
}