/* User Profile Styles */

.user-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.user-profile {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.user-profile h2 {
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-info .form-group {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.profile-info .form-group:last-child {
    border-bottom: none;
}

.profile-info label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
    margin-right: 1rem;
}

.profile-info span {
    color: #333;
    flex: 1;
}

/* Users Admin Table Styles (for admin panel) */
.users-admin-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-top: 1rem;
}

.user-form,
.users-list {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    min-width: 0;
}

.user-form h3,
.users-list h3 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: auto;
    word-wrap: break-word;
}

.users-table th,
.users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.users-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.users-table tbody tr:hover {
    background-color: #f8f9fa;
}

.user-role {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    min-width: 50px;
    line-height: 1.2;
}

.user-role.admin {
    background-color: #dc3545;
    color: white;
}

.user-role.user {
    background-color: #28a745;
    color: white;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.user-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    white-space: nowrap;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #c82333;
}

.loading-message,
.empty-message {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Form styles specific to user creation */
.user-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.user-form .form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
}

.user-form input[type="email"],
.user-form input[type="password"],
.user-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.user-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Responsive design */
@media (max-width: 768px) {
    .users-admin-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .user-form,
    .users-list {
        width: 100%;
        box-sizing: border-box;
        padding: 1.25rem;
    }
    
    .users-table {
        font-size: 0.85rem;
        width: 100%;
        table-layout: auto;
        min-width: auto;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.6rem 0.4rem;
        vertical-align: top;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    .users-table th {
        font-size: 0.8rem;
        padding: 0.7rem 0.4rem;
    }
    
    .user-container {
        padding: 1rem;
    }
    
    /* Header mobile adjustments */
    .header {
        padding: 10px 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header .header-actions {
        display: flex !important;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .header .header-actions .btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    /* User profile mobile */
    .user-profile {
        padding: 1.5rem;
    }
    
    .profile-info .form-group {
        padding: 0.5rem 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .profile-info label {
        min-width: auto;
        margin-right: 0;
        font-size: 14px;
    }
    
    .profile-info span {
        font-size: 14px;
    }
    
    /* Ensure all buttons are touch-friendly */
    .btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Better spacing for form elements */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Improve input focus visibility */
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
}

@media (max-width: 480px) {
    .users-admin-container {
        gap: 1rem;
        margin-top: 0.5rem;
    }
    
    .user-form,
    .users-list {
        padding: 1rem;
    }
    
    .users-table {
        font-size: 0.8rem;
        width: 100%;
        table-layout: fixed;
        min-width: auto;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.5rem 0.3rem;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Optimize column widths for small screens */
    .users-table th:nth-child(1),
    .users-table td:nth-child(1) { /* Email */
        width: 35%;
    }
    
    .users-table th:nth-child(2),
    .users-table td:nth-child(2) { /* Name */
        width: 25%;
    }
    
    .users-table th:nth-child(3),
    .users-table td:nth-child(3) { /* Role */
        width: 20%;
    }
    
    .users-table th:nth-child(4),
    .users-table td:nth-child(4) { /* Actions */
        width: 20%;
    }
    
    .user-role {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        border-radius: 3px;
        display: inline-block;
        line-height: 1.2;
    }
    
    .user-actions {
        flex-direction: column;
        gap: 0.3rem;
        width: 100%;
    }
    
    .user-actions .btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        width: 100%;
        text-align: center;
        min-height: 32px;
        line-height: 1.2;
    }
    
    .user-container {
        padding: 0.75rem;
    }
    
    .user-form h3,
    .users-list h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    /* Very small screen adjustments */
    .header .header-actions .btn {
        padding: 5px 8px;
        font-size: 12px;
        min-height: 36px;
    }
    
    .user-info {
        display: none; /* Hide on very small screens to save space */
    }
    
    .user-profile {
        padding: 1rem;
    }
    
    .user-profile h2 {
        font-size: 18px;
        margin-bottom: 1rem;
    }
    
    .profile-info .form-group {
        padding: 0.4rem 0;
    }
    
    .profile-info label {
        font-size: 13px;
        font-weight: 500;
    }
    
    .profile-info span {
        font-size: 13px;
    }
    
    /* Touch-friendly logout button */
    #logout-btn {
        min-height: 44px;
        padding: 10px 16px;
    }
}

/* User Page Specific Overrides */
body {
    height: auto;
    min-height: 100vh;
    min-height: var(--app-height);
}

#app {
    height: auto;
    min-height: 100vh;
    min-height: var(--app-height);
}
