/* 
* Dual Search - Modern Table and Search Styles
* For HMI Cabang Bandung Members Page
*/

:root {
    /* Color Variables */
    --primary-color: #328E6E;
    --primary-dark: #046b30;
    --secondary-color: #2ecc71;
    --secondary-dark: #E1EEBC;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #2ecc71;
    --info-color: #3498db;
    --gray-light: #f5f5f5;
    --gray: #ddd;
    --gray-dark: #95a5a6;
    
    /* Font Variables */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;
    
    /* Sizing Variables */
    --header-height: 70px;
    --container-width: 1450px;
    --border-radius: 4px;
    --transition-speed: 0.3s;
}

/* Modern Table Styles */
.data-table-container {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.data-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background-color: #f8f9fa;
    color: #495057;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
}

.data-table thead th:hover {
    background-color: #e9ecef;
}

.data-table thead th.sort-asc .sort-icon .fa-sort-up {
    opacity: 1;
}

.data-table thead th.sort-desc .sort-icon .fa-sort-down {
    opacity: 1;
}

.data-table tbody tr {
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-in-out;
}

.data-table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.data-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

.data-table .actions {
    white-space: nowrap;
}

.data-table .actions .btn {
    margin: 0 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.data-table .btn-info {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.data-table .btn-edit {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.data-table .no-results {
    padding: 2rem;
    color: #6c757d;
}

/* Search Bar Styles */
.search-section {
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.search-heading {
    font-size: 1.2rem;
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

.search-form .input-group {
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-form .form-control {
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    box-shadow: none;
    border-radius: 50px 0 0 50px;
}

.search-form .btn-primary {
    border-radius: 0 50px 50px 0;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.search-form .btn-outline-secondary {
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

/* Search Content and Context */
.search-results-info {
    background-color: rgba(0, 123, 255, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.search-results-info h5 {
    margin-top: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.search-results-info p {
    margin-bottom: 10px;
}

.search-type-toggle {
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.search-type-toggle:hover {
    opacity: 1;
}

/* Input Styling */
.search-input-wrapper {
    width: 100%;
    position: relative;
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    z-index: 10;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.search-clear-btn:hover {
    background-color: rgba(108, 117, 125, 0.1);
}

/* Highlighting for Search Terms */
mark, .mark {
    background-color: rgba(255, 243, 148, 0.7);
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* Komisariat Badge in Search Results */
.komisariat-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    border: 1px solid #dee2e6;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #212529;
}

.komisariat-badge:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pagination li {
    margin: 0;
}

.pagination .page-link {
    padding: 0.5rem 1rem;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
}

/* Filter Row Styling */
.filter-row th {
    padding: 8px !important;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.filter-select {
    font-size: 0.8rem;
    padding: 0.25rem;
    border-radius: 4px;
    border: 1px solid #ced4da;
    width: 100%;
}

/* Modal Styling for Advanced Search */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    animation: modalSlideIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #343a40;
}

/* Komisariat Card Styles */
.komisariat-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.komisariat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.komisariat-card .card-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #212529;
}

.komisariat-description {
    color: #6c757d;
    margin-bottom: 15px;
}

.member-count {
    margin-bottom: 0;
    color: #495057;
}

.member-count strong {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.komisariat-card .card-footer {
    background-color: rgba(0,0,0,0.02);
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1rem;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .search-form .input-group {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .search-form .form-control {
        border-radius: 15px;
        margin-bottom: 10px;
    }
    
    .search-form .btn-primary {
        border-radius: 15px;
        width: 100%;
    }
    
    .search-form .btn-outline-secondary {
        margin-top: 10px !important;
        width: 100%;
        margin-left: 0 !important;
    }
    
    .data-table th, .data-table td {
        padding: 0.75rem;
    }
    
    .data-table-container {
        border-radius: 10px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border-bottom: 2px solid #e9ecef;
    }
    
    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        text-align: right;
        padding: 0.5rem 1rem;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        float: left;
        text-align: left;
    }
    
    .data-table tbody td:last-child {
        border-bottom: 0;
    }
    
    .data-table tbody td.actions {
        justify-content: center;
        padding-top: 1rem;
    }
    
    .data-table .actions .btn {
        margin: 0 0.5rem;
    }
    
    .search-results-info {
        padding: 12px;
    }
    
    .search-heading {
        font-size: 1.1rem;
    }
}