/* ========================================
   USER MODALS - DESIGN PADRONIZADO
   ======================================== */

/* Modal Base */
.user-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalFadeIn 0.15s ease;
}

.user-modal-overlay.show {
    display: flex;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.user-modal {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.user-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 42px;
    min-height: 42px;
    padding: 0 16px;
    background: #252525;
    border-bottom: 1px solid #333;
}

.user-modal-header h2 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.user-modal-header h2 i {
    color: var(--primary-color);
    font-size: 14px;
}

.modal-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    padding: 0;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

/* Modal Body */
.user-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    background: #1a1a1a;
}

/* Profile Section */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 6px;
}

.profile-avatar-container {
    position: relative;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.profile-avatar-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary-color);
}

.profile-avatar-upload {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--primary-color);
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-avatar-upload:hover {
    transform: scale(1.1);
}

.profile-avatar-upload i {
    font-size: 10px;
    color: white;
}

.profile-info-summary {
    flex: 1;
}

.profile-info-summary h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.profile-info-summary p {
    color: #888;
    margin-bottom: 2px;
    font-size: 12px;
}

.profile-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 6px;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group label i {
    color: var(--primary-color);
    margin-right: 4px;
    font-size: 10px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--text-light);
    font-size: 12px;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
}

.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
    outline: 2px solid var(--focus-ring-color, #6366f1);
    outline-offset: 2px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #555;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 10px;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.settings-section-title i {
    color: var(--primary-color);
    font-size: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 8px;
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item-info h4 {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 2px;
}

.settings-item-info p {
    font-size: 10px;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #333;
    transition: 0.2s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #666;
    transition: 0.2s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(52, 152, 219, 0.3);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background: var(--primary-color);
}

/* Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.project-card:hover {
    border-color: rgba(52, 152, 219, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.project-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-card-title h4 {
    font-size: 12px;
    color: var(--text-light);
}

.project-permission-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.permission-view {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.permission-edit {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}

.permission-admin {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.project-owner {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.project-card-actions {
    display: flex;
    gap: 4px;
}

.project-card-actions button {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 11px;
    color: #666;
}

.project-card-actions button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

.project-card-body {
    color: #888;
    font-size: 11px;
    margin-bottom: 8px;
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
}

.project-shared-by {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-shared-by i {
    color: var(--primary-color);
    font-size: 10px;
}

/* Modal Footer */
.user-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #1e1e1e;
    border-top: 1px solid #333;
}

.user-modal-footer .modal-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-modal-footer .modal-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
}

.user-modal-footer .modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.user-modal-footer .modal-btn-primary {
    background: rgba(52, 152, 219, 0.15);
    color: var(--primary-color);
}

.user-modal-footer .modal-btn-primary:hover {
    background: rgba(52, 152, 219, 0.25);
}

.user-modal-footer .modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px 16px;
}

.empty-state i {
    font-size: 36px;
    color: #444;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.empty-state p {
    color: #666;
    font-size: 11px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 32px 16px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert Messages */
.alert-message {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.2);
    color: #3498db;
}

/* Responsive */
@media (max-width: 600px) {
    .user-modal {
        width: 95%;
        max-height: 95vh;
    }

    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .project-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
