/**
 * User Data Display - Styles
 * Version: 1.8.1
 */

/* Search Form */
.udd-search-wrapper {
    margin-bottom: 20px;
    background: #f6f8fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
}

.udd-search-form {
    margin: 0;
}

.udd-search-field-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.udd-search-label {
    font-weight: 600;
    font-size: 14px;
    color: #24292e;
    white-space: nowrap;
}

.udd-search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.udd-search-input:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.udd-search-btn {
    padding: 0px 15px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.udd-search-btn:hover {
    background: #218838;
}

.udd-search-btn:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

.udd-search-btn:active {
    background: #1e7e34;
}

.udd-search-clear {
    padding: 8px 16px;
    background: #ffc107;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.udd-search-clear:hover {
    background: #e0a800;
    color: #000;
    text-decoration: none;
}

/* Filter Form */
.udd-filter-wrapper {
    background: #f6f8fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e1e4e8;
}

.udd-filter-form {
    width: 100%;
}

.udd-filter-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.udd-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.udd-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #24292e;
}

.udd-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #24292e;
    transition: border-color 0.2s ease;
}

.udd-filter-select:hover {
    border-color: #959da5;
}

.udd-filter-select:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.udd-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.udd-filter-btn {
    padding: 0px 15px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.udd-filter-btn:hover {
    background: #218838;
}

.udd-filter-btn:active {
    background: #1e7e34;
}

.udd-filter-reset {
    padding: 8px 15px;
    background: #ffc107;
    color: #000000;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.udd-filter-reset:hover {
    background: #e0a800;
    color: #000;
    text-decoration: none;
}

/* Pagination */
.udd-pagination-wrapper {
    margin-top: 20px;
    padding: 15px;
    background: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
}

.udd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.udd-page-link {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    color: #0366d6;
    text-decoration: none;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.udd-page-link:hover {
    background: #0366d6;
    color: #fff;
    border-color: #0366d6;
    text-decoration: none;
}

.udd-page-link.udd-current {
    background: #0366d6;
    color: #fff;
    border-color: #0366d6;
    cursor: default;
}

.udd-page-link.udd-prev,
.udd-page-link.udd-next {
    font-weight: 600;
}

.udd-page-dots {
    padding: 6px 8px;
    color: #586069;
    font-weight: bold;
}

.udd-pagination-info {
    text-align: center;
    font-size: 13px;
    color: #586069;
    font-weight: 500;
}

/* Container */
.udd-container {
    margin: 20px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    width: 100%;
    max-width: 100%;
}

/* Table Wrapper */
.udd-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch;
}

/* Table Styles */
.udd-users-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
    min-width: 600px;
}

.udd-users-table thead {
    background: #f6f8fa;
    border-bottom: 2px solid #e1e4e8;
}

.udd-users-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #24292e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e1e4e8;
    white-space: nowrap;
}

.udd-users-table tbody tr {
    border-bottom: 1px solid #e1e4e8;
    transition: background-color 0.2s ease;
}

.udd-users-table tbody tr:hover {
    background-color: #f6f8fa;
}

.udd-users-table tbody tr:last-child {
    border-bottom: none;
}

.udd-users-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: #24292e;
    vertical-align: middle;
}

/* Avatar Column */
.udd-avatar-col {
    width: 70px;
}

.udd-avatar-cell {
    text-align: center;
}

.udd-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e1e4e8;
}

/* ID Column */
.udd-id-col {
    width: 80px;
}

.udd-user-id {
    display: inline-block;
    padding: 4px 10px;
    background: #e1e4e8;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    color: #586069;
}

/* Name Column */
.udd-name-cell strong {
    color: #0366d6;
    font-weight: 600;
}

/* Name & Email Column (Combined) */
.udd-name-email-col {
    min-width: 250px;
}

.udd-name-email-wrapper {
    display: flex;
    flex-direction: column;
}

.udd-name {
    font-weight: 600;
    font-size: 15px;
    color: #24292e;
    display: block;
}

.udd-email-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.udd-email-link {
    color: #0366d6;
    text-decoration: none;
    transition: color 0.2s ease;
    word-break: break-word;
    flex: 1;
    min-width: 0;
    font-size: 15px;
}

.udd-email-link:hover {
    color: #0256c2;
    text-decoration: underline;
}

.udd-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0px 10px;
    background: #f6f8fa;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    color: #24292e;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 25px;
}

.udd-copy-btn:hover {
    background: #e1e4e8;
    border-color: #959da5;
}

.udd-copy-btn:focus {
    outline: 2px solid #0366d6;
    outline-offset: 2px;
}

.udd-copy-btn:active {
    background: #d1d5da;
}

.udd-copy-btn.udd-copied {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.udd-copy-text {
    font-size: 11px;
}

/* Roles Column */
.udd-roles {
    display: inline-block;
    padding: 4px 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #856404;
    white-space: nowrap;
}

/* Last Login Column */
.udd-lastlogin-col {
    width: 240px;
}

.udd-lastlogin {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.udd-lastlogin-datetime {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.udd-lastlogin-full {
    font-weight: 600;
    font-size: 13px;
    color: #24292e;
    line-height: 1.4;
}

.udd-lastlogin-relative {
    font-size: 11px;
    color: #6a737d;
    font-style: italic;
}

.udd-lastlogin-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 4px;
    border-top: 1px solid #e1e4e8;
}

.udd-lastlogin-ip,
.udd-lastlogin-device {
    font-size: 11px;
    color: #586069;
    display: flex;
    align-items: center;
    gap: 4px;
    word-break: break-word;
}

.udd-lastlogin-ip {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.udd-no-lastlogin {
    color: #959da5;
    font-style: italic;
}

/* User Group Column */
.udd-group-col {
    width: 150px;
}

.udd-group {
    display: inline-block;
    padding: 4px 10px;
    background: #d1ecf1;
    border: 1px solid #17a2b8;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #0c5460;
    white-space: nowrap;
}

.udd-no-group {
    color: #959da5;
    font-style: italic;
}

/* Phone Number Column */
.udd-phone-col {
    width: 180px;
}

.udd-phone-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.udd-phone-link {
    color: #0366d6;
    text-decoration: none;
    transition: color 0.2s ease;
    word-break: normal;
    white-space: nowrap;
    font-size: 14px;
}

.udd-phone-link:hover {
    color: #0256c2;
    text-decoration: underline;
}

.udd-no-phone {
    color: #959da5;
    font-style: italic;
}

/* Action Column */
.udd-action-col {
    width: 100px;
    text-align: center;
}

.udd-action-cell {
    text-align: center;
}

.udd-edit-btn {
    display: inline-block;
    padding: 6px 16px;
    background: #0366d6;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.udd-edit-btn:hover {
    background: #0256c2;
    color: #fff;
    text-decoration: none;
}

.udd-edit-btn:focus {
    outline: 2px solid #0366d6;
    outline-offset: 2px;
}

.udd-edit-btn:active {
    background: #024ea4;
}

/* Switch Column */
.udd-switch-col {
    width: 100px;
    text-align: center;
}

.udd-switch-cell {
    text-align: center;
}

.udd-switch-btn {
    display: inline-block;
    padding: 6px 16px;
    background: #dc3545;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.udd-switch-btn:hover {
    background: #c82333;
    color: #fff;
    text-decoration: none;
}

.udd-switch-btn:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.udd-switch-btn:active {
    background: #bd2130;
}

.udd-no-switch {
    color: #959da5;
    font-style: italic;
}

/* Footer */
.udd-footer {
    padding: 12px 16px;
    background: #f6f8fa;
    border-top: 1px solid #e1e4e8;
    border-radius: 0 0 6px 6px;
}

.udd-total-users {
    margin: 0;
    font-size: 13px;
    color: #586069;
    font-weight: 600;
}

/* No Users Message */
.udd-no-users {
    padding: 40px 20px;
    text-align: center;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
}

.udd-no-users p {
    margin: 0;
    color: #586069;
    font-size: 16px;
}

/* Error Message */
.udd-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin: 20px 0;
}

.udd-error p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

/* Responsive Design - Tablet */
@media screen and (max-width: 1024px) {
    .udd-users-table {
        min-width: 950px;
        font-size: 13px;
    }
    
    .udd-users-table thead th,
    .udd-users-table tbody td {
        padding: 10px 12px;
    }
    
    .udd-avatar {
        width: 40px;
        height: 40px;
    }
    
    .udd-avatar-col {
        width: 60px;
    }
    
    .udd-name-email-col {
        min-width: 220px;
    }
    
    .udd-group-col {
        width: 130px;
    }
    
    .udd-lastlogin-col {
        width: 220px;
    }
    
    .udd-switch-col {
        width: 90px;
    }
    
    .udd-action-col {
        width: 90px;
    }
    
    .udd-edit-btn,
    .udd-switch-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .udd-copy-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .udd-name {
        font-size: 17px;
    }
    
    .udd-email-link {
        font-size: 17px;
    }
    
    .udd-lastlogin-full {
        font-size: 12px;
    }
    
    .udd-lastlogin-relative,
    .udd-lastlogin-ip,
    .udd-lastlogin-device {
        font-size: 10px;
    }
}

@media screen and (max-width: 768px) {
    .udd-container {
        margin: 0;
    }
    
    /* Search responsive */
    .udd-search-field-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .udd-search-label {
        margin-bottom: 5px;
    }
    
    .udd-search-input {
        width: 100%;
        min-width: auto;
    }
    
    .udd-search-btn,
    .udd-search-clear {
        width: 100%;
        text-align: center;
    }
    
    /* Filter responsive */
    .udd-filter-fields {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .udd-filter-actions {
        flex-direction: column;
    }
    
    .udd-filter-btn,
    .udd-filter-reset {
        width: 100%;
        text-align: center;
    }
    
    /* Pagination responsive */
    .udd-pagination {
        gap: 3px;
    }
    
    .udd-page-link {
        padding: 5px 10px;
        font-size: 13px;
        min-width: 35px;
    }
    
    .udd-page-link.udd-prev,
    .udd-page-link.udd-next {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    /* Table responsive */
    .udd-users-table {
        min-width: 450px;
        font-size: 12px;
    }
    
    .udd-users-table thead th,
    .udd-users-table tbody td {
        padding: 8px 10px;
    }
    
    .udd-avatar {
        width: 35px;
        height: 35px;
    }
    
    .udd-avatar-col {
        width: 55px;
    }
    
    .udd-id-col {
        width: 70px;
    }
    
    .udd-user-id {
        padding: 3px 8px;
        font-size: 11px;
    }
}

/* Responsive Design - Mobile */
@media screen and (max-width: 640px) {
    .udd-container {
        margin: 0;
    }
    
    .udd-table-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .udd-users-table {
        min-width: 100%;
    }
    
    /* Hide thead and use card-style layout */
    .udd-users-table thead {
        display: none;
    }
    
    .udd-users-table,
    .udd-users-table tbody,
    .udd-users-table tr {
        display: block;
        width: 100%;
    }
    
    .udd-users-table tr {
        margin-bottom: 12px;
        border: 1px solid #e1e4e8;
        border-radius: 6px;
        padding: 12px;
        background: #fff;
    }
    
    .udd-users-table tr:hover {
        background: #f6f8fa;
    }
    
    .udd-users-table td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .udd-users-table td:last-child {
        border-bottom: none;
    }
    
    /* Avatar di mobile - centered */
    .udd-avatar-cell {
        text-align: center;
        padding: 10px 0 15px 0;
        border-bottom: 2px solid #e1e4e8 !important;
    }
    
    .udd-avatar {
        width: 60px;
        height: 60px;
    }
    
    /* Add labels for mobile */
    .udd-id-cell::before,
    .udd-name-email-cell::before,
    .udd-group-cell::before,
    .udd-roles-cell::before,
    .udd-lastlogin-cell::before,
    .udd-switch-cell::before,
    .udd-action-cell::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 11px;
        color: #586069;
        text-transform: uppercase;
        margin-bottom: 5px;
        letter-spacing: 0.5px;
    }
    
    .udd-id-cell::before {
        content: "User ID";
    }
    
    .udd-name-email-cell::before {
        content: "Nama & Email";
    }
    
    .udd-group-cell::before {
        content: "User Group";
    }
    
    .udd-roles-cell::before {
        content: "Display Role Name";
    }
    
    .udd-lastlogin-cell::before {
        content: "Last Login";
    }
    
    .udd-switch-cell::before {
        content: "Switch";
    }
    
    .udd-action-cell::before {
        content: "Action";
    }
    
    /* ID styling for mobile */
    .udd-id-cell {
        padding-top: 12px;
    }
    
    .udd-user-id {
        display: inline-block;
        font-size: 13px;
    }
    
    /* Name styling for mobile */
    .udd-name-cell strong {
        font-size: 16px;
    }
    
    /* Email styling for mobile */
    .udd-email-cell a {
        font-size: 13px;
        display: inline-block;
    }
    
    /* Roles styling for mobile */
    .udd-roles {
        display: inline-block;
        margin-top: 5px;
    }
    
    /* Name & Email wrapper for mobile */
    .udd-name-email-wrapper {
        margin-top: 5px;
    }
    
    .udd-name {
        display: block;
        margin-bottom: 6px;
    }
    
    /* Email wrapper for mobile */
    .udd-email-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .udd-copy-btn {
        margin-top: 2px;
    }
    
    /* Last Login styling for mobile */
    .udd-lastlogin {
        margin-top: 5px;
    }
    
    .udd-lastlogin-datetime,
    .udd-lastlogin-details {
        display: flex;
        flex-direction: column;
    }
    
    .udd-lastlogin-full,
    .udd-lastlogin-relative,
    .udd-lastlogin-ip,
    .udd-lastlogin-device {
        display: block;
    }
    
    .udd-no-lastlogin {
        display: inline-block;
        margin-top: 5px;
    }
    
    /* Roles styling for mobile */
    .udd-group {
        display: inline-block;
        margin-top: 5px;
    }
    
    .udd-no-group {
        display: inline-block;
        margin-top: 5px;
    }
    
    /* Action button styling for mobile */
    .udd-action-cell {
        text-align: left;
        padding-top: 12px;
    }
    
    .udd-edit-btn {
        display: inline-block;
        width: auto;
        margin-top: 5px;
    }
    
    /* Switch button styling for mobile */
    .udd-switch-cell {
        text-align: left;
        padding-top: 12px;
    }
    
    .udd-switch-btn {
        display: inline-block;
        width: auto;
        margin-top: 5px;
    }
    
    .udd-no-switch {
        display: inline-block;
        margin-top: 5px;
    }
    
    /* Footer responsive */
    .udd-footer {
        border-radius: 0;
        text-align: center;
    }
}

/* Extra small devices */
@media screen and (max-width: 375px) {
    .udd-users-table td {
        padding: 6px 0;
    }
    
    .udd-avatar {
        width: 50px;
        height: 50px;
    }
    
    .udd-name-cell strong {
        font-size: 15px;
    }
    
    .udd-email-cell a {
        font-size: 12px;
    }
    
    /* Pagination extra small */
    .udd-page-link {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 30px;
    }
    
    .udd-page-link.udd-prev,
    .udd-page-link.udd-next {
        font-size: 11px;
    }
    
    .udd-pagination-info {
        font-size: 12px;
    }
}

/* Loading Animation */
.udd-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.udd-loading:after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #e1e4e8;
    border-top-color: #0366d6;
    border-radius: 50%;
    animation: udd-spin 1s linear infinite;
}

@keyframes udd-spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .udd-container {
        margin: 0;
    }
    
    .udd-table-wrapper {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .udd-users-table {
        border-collapse: collapse;
    }
    
    .udd-users-table thead {
        background: #f0f0f0;
        display: table-header-group;
    }
    
    .udd-users-table tbody tr {
        display: table-row;
        page-break-inside: avoid;
    }
    
    .udd-users-table td {
        display: table-cell;
        border: 1px solid #ddd;
    }
    
    .udd-users-table tbody tr:hover {
        background: none;
    }
    
    .udd-email-cell a {
        color: #000;
        text-decoration: none;
    }
    
    .udd-avatar {
        width: 30px;
        height: 30px;
    }
}

/* Accessibility */
.udd-users-table:focus-within {
    outline: 2px solid #0366d6;
    outline-offset: 2px;
}

.udd-users-table a:focus {
    outline: 2px solid #0366d6;
    outline-offset: 2px;
    border-radius: 2px;
}
/* Clear Activity Log */
.udd-clear-log-wrapper {
    margin: 0;
}

.udd-clear-log-form {
    display: flex;
    justify-content: flex-end;
}

.udd-clear-logs-btn {
    padding: 0px 15px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.udd-clear-logs-btn:hover {
    background: #c82333;
}

.udd-clear-logs-btn:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.udd-clear-logs-btn:active {
    background: #bd2130;
}
.udd-filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.udd-filter-form {
    width: 100%;
    flex: 1;
}
/* Notices */
.udd-notice {
    padding: 14px 16px;
    border-radius: 6px;
    margin: 0 0 20px;
    border: 1px solid;
}

.udd-notice p {
    margin: 0;
    font-weight: 500;
}

.udd-notice-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.udd-notice-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
@media (max-width: 600px) {
    .udd-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .udd-clear-log-form {
        width: 100%;
        justify-content: stretch;
    }

    .udd-clear-logs-btn {
        width: 100%;
    }
}