/**
 * 5K TaskForce Admin Styles
 * 
 * Shared styles for all 5K TaskForce admin pages
 */

/* Card layout */
.wrap h1 {
    margin-bottom: 20px;
}
.card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.card h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
}

/* User details page styles */
#5k-user-details-page .user-profile {
    display: flex;
    flex-direction: column;
}

.user-details-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-avatar {
    margin-right: 20px;
}

.user-meta {
    flex-grow: 1;
}

.user-meta h2 {
    margin: 0 0 5px;
    padding: 0;
    border: none;
}

.user-email, .user-role {
    margin: 5px 0;
}

.verified-badge {
    background: #46b450;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 5px;
}

.unverified-badge {
    background: #dc3232;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 5px;
}

.user-credits {
    text-align: center;
    margin-left: 20px;
}

.credits-display {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
}

.credits-count {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #0073aa;
}

.credits-label {
    font-size: 14px;
    color: #666;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.user-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.user-details-grid .card {
    margin-bottom: 0;
}

.credit-assign-mini {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.credit-adjust-controls {
    display: flex;
    gap: 10px;
}

.relationship-section {
    margin-bottom: 20px;
}

.relationship-section:last-child {
    margin-bottom: 0;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 15px;
}
.wp-list-table {
    width: 100%;
    border-spacing: 0;
}
.wp-list-table th {
    font-weight: 600;
}
.wp-list-table th, 
.wp-list-table td {
    padding: 8px 10px;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}
.action-buttons .button {
    margin: 0;
}

/* Form styles */
.5k-form .form-table th {
    width: 150px;
}
.5k-form .form-table td input[type="text"],
.5k-form .form-table td input[type="number"],
.5k-form .form-table td select {
    min-width: 25rem;
}

/* User table */
.users-table .column-id {
    width: 5%;
}
.users-table .column-name {
    width: 15%;
}
.users-table .column-email {
    width: 20%;
}
.users-table .column-role {
    width: 10%;
}
.users-table .column-credits {
    width: 10%;
}
.users-table .column-activity {
    width: 15%;
}
.users-table .column-actions {
    width: 25%;
    text-align: right;
}

/* API table */
.apis-table .column-name {
    width: 20%;
}
.apis-table .column-key {
    width: 20%;
}
.apis-table .column-type {
    width: 25%;
}
.apis-table .column-value {
    width: 15%;
}
.apis-table .column-actions {
    width: 20%;
    text-align: right;
}

/* Module tables */
.api-config {
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    display: flex;
    gap: 10px;
    align-items: center;
}
.api-config select,
.api-config input {
    min-width: 150px;
}

/* Role-related styling */
.role-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: white;
    margin-right: 3px;
}

.role-badge.admin {
    background-color: #32373c;
}

.role-badge.main-user {
    background-color: #0073aa;
}

.role-badge.sub-user {
    background-color: #46b450;
}

.role-filters {
    margin: 20px 0;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0;
}

.role-filters a {
    display: inline-block;
    padding: 10px 15px;
    margin-right: 5px;
    text-decoration: none;
    color: #555;
    background: #f7f7f7;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.role-filters a.current {
    background: #fff;
    color: #000;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    font-weight: 600;
}

.parent-info {
    margin-top: 3px;
    font-size: 12px;
    color: #666;
}

.subusers-controls {
    margin-top: 15px;
}

/* User relationship styles */
.parent-badge, 
.sub-badge,
.no-parent-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    background: #e7f5fa;
    color: #0073aa;
    border: 1px solid #b3e0f3;
}

.no-parent-badge {
    background: #fff8e5;
    color: #ffba00;
    border: 1px solid #ffdf8e;
}

.parent-badge.empty {
    background: #f5f5f5;
    color: #777;
    border-color: #ddd;
}

.sub-badge {
    background: #e7f9e7;
    color: #46b450;
    border: 1px solid #c1e8c1;
}

.sub-badge.warning {
    background: #fff8e5;
    color: #ffba00;
    border: 1px solid #ffdf8e;
}

/* Media Queries */
@media screen and (max-width: 782px) {
    .5k-form .form-table td input[type="text"],
    .5k-form .form-table td input[type="number"],
    .5k-form .form-table td select {
        min-width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .user-details-grid {
        grid-template-columns: 1fr;
    }
    
    .user-details-header {
        flex-direction: column;
        text-align: center;
    }
    
    .user-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .user-credits {
        margin-left: 0;
        margin-top: 15px;
    }
    
    .credit-adjust-controls {
        flex-direction: column;
    }
}
