/**
 * KGMB Semua Ahli Custom Styles
 */

/* Container styling */
.kgmb-semua-ahli-container {
    padding: 1rem 0;
}

/* Status Cards */
.status-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: linear-gradient(155deg, #3a3c2d 0%, #357717 100%) !important;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}

.status-card.active {
    border-color: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3) !important;
}

.status-card .card-body {
    padding: 1.5rem !important;
}

.status-card h4 {
    color: #ffc107 !important;
    font-weight: 700;
    font-size: 2rem;
}

.status-card .text-muted {
    color: white !important;
    font-weight: 500;
    font-size: 1rem;
}

/* Main table card */
.card.border-0.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    background-color: #f7f3df !important;
    border-radius: 0.5rem;
}

.card-header {
    background: linear-gradient(135deg, #166534 0%, #1e7e34 100%) !important;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    padding: 1rem 1.5rem;
}

.card-title {
    color: white !important;
    font-size: 1.25rem !important;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem !important;
    background-color: #f7f3df !important;
}

/* Filter and buttons */
#status-filter-semua-ahli {
    min-width: 160px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.add-ahli-btn {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
    font-weight: 600;
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
}

.add-ahli-btn:hover {
    background-color: #ffca2c !important;
    border-color: #ffc720 !important;
    color: #000 !important;
    transform: translateY(-1px);
}

/* DataTable styling */
#semua-ahli-table {
    background-color: white;
    border-radius: 0.375rem;
    overflow: hidden;
}

#semua-ahli-table thead th {
    background: linear-gradient(135deg, #166534 0%, #1e7e34 100%) !important;
    color: white !important;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    white-space: nowrap;
}

#semua-ahli-table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

#semua-ahli-table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Status badges */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.badge.bg-success {
    background-color: #198754 !important;
    color: white;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
    color: white;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
    color: white;
}

/* Action buttons */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: 0.25rem;
}

.btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

.btn-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

.btn-warning:hover {
    background-color: #ffca2c !important;
    border-color: #ffc720 !important;
}

/* Modal styling */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, #166534 0%, #1e7e34 100%) !important;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem 1.5rem;
}

.modal-title {
    color: white !important;
    font-size: 1.25rem !important;
    font-weight: 600;
    margin: 0;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body {
    background-color: #f7f3df !important;
    padding: 1.5rem;
}

.modal-footer {
    background-color: #f7f3df !important;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem 1.5rem;
}

/* Form styling */
.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: #166534;
    box-shadow: 0 0 0 0.2rem rgba(22, 101, 52, 0.25);
}

/* Section headers in forms */
.border-bottom {
    border-bottom: 2px solid #166534 !important;
    color: #166534;
    font-weight: 600;
}

/* Buttons in modals */
.modal .btn-primary {
    background-color: #166534 !important;
    border-color: #166534 !important;
    color: white;
}

.modal .btn-primary:hover {
    background-color: #1e7e34 !important;
    border-color: #1e7e34 !important;
}

.modal .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

/* DataTable pagination and controls */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin: 1rem 0;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin: 1rem 0;
}

.page-link {
    color: #166534;
}

.page-item.active .page-link {
    background-color: #166534;
    border-color: #166534;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .kgmb-semua-ahli-container {
        padding: 0.5rem;
    }
    
    .status-card .card-body {
        padding: 1rem !important;
    }
    
    .status-card h4 {
        font-size: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .card-header .d-flex {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    #status-filter-semua-ahli {
        min-width: auto;
        width: 100%;
    }
    
    .modal-dialog.modal-xl {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .row.mb-4 .col-xl-3 {
        margin-bottom: 1rem;
    }
    
    .status-card h4 {
        font-size: 1.25rem;
    }
    
    .status-card .text-muted {
        font-size: 0.875rem;
    }
    
    #semua-ahli-table {
        font-size: 0.8125rem;
    }
    
    #semua-ahli-table thead th,
    #semua-ahli-table tbody td {
        padding: 0.5rem 0.25rem;
    }
}

/* Loading states */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #0f5132;
    border-left: 4px solid #198754;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #842029;
    border-left: 4px solid #dc3545;
}

/* Hover effects */
.status-card,
.btn,
.form-control,
.form-select {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar for table */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

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

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

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #1e7e34;
}

/* Text utilities */
.text-danger {
    color: #dc3545 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fs-5 {
    font-size: 1.25rem !important;
}

.fs-6 {
    font-size: 1rem !important;
}

/* Additional spacing */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.gap-2 > * + * {
    margin-left: 0.5rem;
}