﻿
/* Main Container */
.user-management-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0066cc;
}

    .page-header h2 {
        margin: 0;
        color: #333;
    }

/* Add User Button */
.btn-add-user {
    background-color: #0066cc;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

    .btn-add-user:hover {
        background-color: #0052a3;
    }

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

    .modal-overlay.active {
        display: flex;
        justify-content: center;
        align-items: center;
    }

/* Modal Content */
.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        margin: 0;
        color: #333;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

    .modal-close:hover {
        color: #333;
    }

.modal-body {
    padding: 20px;
}

/* Search Section */
.search-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

    .search-section label {
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
        color: #333;
    }

.search-input-group {
    display: flex;
    gap: 10px;
}

    .search-input-group input {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
    }

    .search-input-group button {
        padding: 8px 20px;
        background-color: #0066cc;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
    }

        .search-input-group button:hover {
            background-color: #0052a3;
        }

.search-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Search Results Dropdown */
.search-results {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    width: calc(100% - 120px);
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .search-results.active {
        display: block;
    }

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

    .search-result-item:hover {
        background-color: #f5f5f5;
    }

    .search-result-item .name {
        font-weight: bold;
        color: #333;
    }

    .search-result-item .email {
        font-size: 12px;
        color: #666;
    }

/* Form Fields */
.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
        color: #333;
    }

        .form-group label.required:after {
            content: " *";
            color: red;
        }

    .form-group input[type="text"],
    .form-group select {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
        box-sizing: border-box;
    }

        .form-group input[type="text"]:disabled {
            background-color: #f5f5f5;
            color: #666;
        }

/* Multi-Select State Dropdown */
.multiselect-container {
    position: relative;
    width: 100%;
}

.multiselect-display {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .multiselect-display:hover {
        border-color: #0066cc;
    }

.multiselect-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .multiselect-dropdown.active {
        display: block;
    }

.multiselect-item {
    padding: 8px 12px;
    cursor: pointer;
}

    .multiselect-item:hover {
        background-color: #f5f5f5;
    }

    .multiselect-item input[type="checkbox"] {
        margin-right: 8px;
    }

.multiselect-search {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

    .multiselect-search input {
        width: 100%;
        padding: 6px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 13px;
    }

/* Message Box */
.message-box {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: none;
}

    .message-box.success {
        background-color: #d4edda;
        border: 1px solid #c3e6cb;
        color: #155724;
        display: block;
    }

    .message-box.error {
        background-color: #f8d7da;
        border: 1px solid #f5c6cb;
        color: #721c24;
        display: block;
    }

    .message-box.warning {
        background-color: #fff3cd;
        border: 1px solid #ffeaa7;
        color: #856404;
        display: block;
    }

/* Modal Footer */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

    .modal-footer button {
        padding: 8px 20px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
        font-size: 14px;
    }

.btn-save {
    background-color: #28a745;
    color: white;
}

    .btn-save:hover {
        background-color: #218838;
    }

.btn-cancel {
    background-color: #6c757d;
    color: white;
}

    .btn-cancel:hover {
        background-color: #5a6268;
    }

/* Users Grid */
.users-grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

    .users-grid th {
        background-color: #f8f9fa;
        padding: 12px;
        text-align: left;
        font-weight: bold;
        border-bottom: 2px solid #dee2e6;
    }

    .users-grid td {
        padding: 12px;
        border-bottom: 1px solid #dee2e6;
    }

    .users-grid tr:hover {
        background-color: #f8f9fa;
    }

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

    .role-badge.admin {
        background-color: #dc3545;
        color: white;
    }

    .role-badge.division {
        background-color: #007bff;
        color: white;
    }

    .role-badge.state {
        background-color: #28a745;
        color: white;
    }
/* Pagination Styles */
.gridview-pager {
    background-color: #f8f9fa;
    padding: 15px;
    text-align: center;
    border-top: 2px solid #dee2e6;
}

    .gridview-pager table {
        margin: 0 auto;
    }

    .gridview-pager td {
        padding: 5px 10px;
    }

    .gridview-pager a {
        display: inline-block;
        padding: 8px 12px;
        margin: 0 3px;
        background-color: white;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        color: #0066cc;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s;
    }

        .gridview-pager a:hover {
            background-color: #0066cc;
            color: white;
            border-color: #0066cc;
        }

    .gridview-pager span {
        display: inline-block;
        padding: 8px 12px;
        margin: 0 3px;
        background-color: #0066cc;
        border: 1px solid #0066cc;
        border-radius: 4px;
        color: white;
        font-weight: bold;
    }

/* Page size selector */
.page-size-container {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .page-size-selector label {
        font-weight: 500;
        color: #333;
    }

    .page-size-selector select {
        padding: 6px 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
    }

.grid-info {
    color: #666;
    font-size: 14px;
}

/* Sorting Styles */
.users-grid th {
    position: relative;
    cursor: pointer;
    user-select: none;
}

    .users-grid th a {
        color: #333;
        text-decoration: none;
        display: block;
        padding-right: 20px;
    }

        .users-grid th a:hover {
            color: #0066cc;
        }

        /* Sort arrow indicator */
        .users-grid th a::after {
            content: ' ⇅';
            position: absolute;
            right: 8px;
            color: #ccc;
            font-size: 12px;
        }

    /* Ascending sort */
    .users-grid th.sort-asc a::after {
        content: ' ▲';
        color: #0066cc;
    }

    /* Descending sort */
    .users-grid th.sort-desc a::after {
        content: ' ▼';
        color: #0066cc;
    }

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grid-search-box {
    position: relative;
    margin-left: auto; /* pushes it to the right */
}

    .grid-search-box input {
        padding: 7px 32px 7px 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
        width: 280px;
        outline: none;
    }

        .grid-search-box input:focus {
            border-color: #4a90d9;
            box-shadow: 0 0 0 2px rgba(74,144,217,0.2);
        }

    .grid-search-box .search-icon {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        font-size: 14px;
        color: #888;
    }

.btn-remove {
    background-color: #fff;
    color: #d9534f;
    border: 1px solid #d9534f;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

    .btn-remove:hover {
        background-color: #d9534f;
        color: #fff;
    }

.action-col {
    width: 80px;
    text-align: center;
}

.btn-edit {
    background-color: #fff;
    color: #4a90d9;
    border: 1px solid #4a90d9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

    .btn-edit:hover {
        background-color: #4a90d9;
        color: #fff;
    }

.action-col {
    width: 140px; /* wider now to fit both buttons */
    text-align: center;
    white-space: nowrap;
}

.self-badge {
    font-size: 11px;
    color: #888;
    font-style: italic;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}
