/**
 * Users/Roles Page Responsive Styles
 * Optimized for mobile, tablet, and desktop
 */

/* Users Table Responsive */
.users-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .users-table-wrapper table {
        font-size: 0.85rem;
    }
    
    .users-table-wrapper th,
    .users-table-wrapper td {
        padding: 0.5rem;
    }
    
    .users-table-wrapper .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .users-table-wrapper table {
        font-size: 0.75rem;
    }
    
    .users-table-wrapper th,
    .users-table-wrapper td {
        padding: 0.4rem 0.3rem;
    }
    
    .users-table-wrapper .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
}

/* Page Header with Actions */
.users-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .users-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .users-page-header > div:last-child {
        width: 100%;
    }
    
    .users-page-header .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .users-page-header h1 {
        font-size: 1.25rem;
    }
    
    .users-page-header .btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

/* User Form Grid */
.user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .user-form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .user-form-grid {
        gap: 0.5rem;
    }
    
    .user-form-grid .form-control {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .user-form-grid label {
        font-size: 0.85rem;
    }
}

/* Action Buttons in Table */
.table-actions {
    display: flex;
    gap: 0.25rem;
}

@media (max-width: 768px) {
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-actions .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Compact Table for Mobile */
@media (max-width: 480px) {
    .users-table-wrapper .hide-mobile {
        display: none;
    }
}

/* Empty State */
.users-empty-state {
    text-align: center;
    padding: 3rem;
}

@media (max-width: 768px) {
    .users-empty-state {
        padding: 2rem;
    }
    
    .users-empty-state svg {
        width: 48px;
        height: 48px;
    }
    
    .users-empty-state h3 {
        font-size: 1rem;
    }
    
    .users-empty-state p {
        font-size: 0.85rem;
    }
}

/* Roles Grid */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

@media (max-width: 1024px) {
    .roles-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.875rem;
    }
}

@media (max-width: 768px) {
    .roles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .roles-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Role Card */
.role-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

@media (max-width: 768px) {
    .role-card {
        padding: 0.75rem;
    }
    
    .role-card h4 {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .role-card {
        padding: 0.6rem;
    }
    
    .role-card h4 {
        font-size: 0.85rem !important;
    }
    
    .role-card p {
        font-size: 0.75rem !important;
    }
}

/* Permissions List */
.permissions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .permissions-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .permissions-list {
        grid-template-columns: 1fr;
    }
}

/* User Avatar */
.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

@media (max-width: 480px) {
    .user-avatar {
        width: 36px;
        height: 36px;
    }
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}
