/* PROFILE.CSS - Estilos do modal de perfil */

/* Profile Modal Overlay */
#profileModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal, 1050);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.profile-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Profile Modal Header */
.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.profile-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.profile-modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.profile-modal-close:hover {
    background: #f5f5f5;
    color: var(--color-text);
}

/* Profile Modal Body */
.profile-modal-body {
    padding: var(--spacing-xl);
}

/* Profile Photo Section */
.profile-photo-section {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.profile-photo-container {
    position: relative;
    width: 150px;
    height: 150px;
}

#profilePhoto {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.2);
}

.profile-photo-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

.profile-photo-edit:hover {
    background: #5a00d9;
    transform: scale(1.1);
}

/* Profile Info Section */
.profile-info-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid #f0f0f0;
}

.profile-header-info h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 var(--spacing-sm) 0;
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(var(--color-primary-rgb), 0.1);
    border-radius: var(--radius-full);
    font-size: var(--font-size-small);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-light);
    font-size: var(--font-size-small);
}

.profile-meta-item svg {
    color: var(--color-primary);
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: var(--font-size-small);
    font-weight: 600;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.form-group input:disabled {
    background: #f5f5f5;
    color: var(--color-text-light);
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

/* Profile Form Actions */
.profile-form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid #f0f0f0;
}

.profile-form-actions .btn {
    padding: var(--spacing-sm) var(--spacing-xl);
    min-width: 120px;
}

/* Profile Success Message */
.profile-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-green);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    font-size: var(--font-size-base);
    z-index: var(--z-tooltip, 1070);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.profile-success-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .profile-modal-body {
        padding: var(--spacing-lg);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .profile-form-actions {
        flex-direction: column;
    }
    
    .profile-form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-photo-container {
        width: 120px;
        height: 120px;
    }

    .profile-header-info h3 {
        font-size: 1.5rem;
    }
}

/* ==================== DARK MODE ==================== */

[data-theme="dark"] .profile-modal-content {
    background: #1a1a2e;
}

[data-theme="dark"] .profile-modal-header {
    border-color: #3a3a5c;
    background: #1a1a2e;
}

[data-theme="dark"] .profile-modal-close:hover {
    background: #252545;
}

[data-theme="dark"] .profile-photo-edit {
    border-color: #1a1a2e;
}

[data-theme="dark"] .profile-info-section {
    border-bottom-color: #3a3a5c;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    border-color: #3a3a5c;
    background: #1e1e1e;
    color: #e0e0e0;
}

[data-theme="dark"] .form-group input:disabled {
    background: #252545;
}

[data-theme="dark"] .profile-form-actions {
    border-top-color: #3a3a5c;
}

[data-theme="dark"] .toggle-slider {
    background: #444;
}

[data-theme="dark"] .toggle-slider:before {
    background: #1e1e1e;
}

/* Badge de tempo de empresa */
.tempo-empresa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tempo-empresa-badge::before {
    content: '🎖️';
}

/* Toast de tempo de empresa */
.tenure-toast {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.tenure-toast .toast-icon {
    font-size: 2rem;
}

.tenure-toast .toast-title {
    font-weight: 600;
    color: white;
}

.tenure-toast .toast-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.tenure-toast .toast-points {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 8px;
    display: inline-block;
}

/* ==================== NOTIFICAÇÕES PUSH/DESKTOP ==================== */

/* Container da configuração de notificações push */
.push-notification-setting {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.05) 0%, rgba(var(--color-primary-rgb), 0.02) 100%);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg) !important;
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

.push-notification-setting > label {
    display: flex;
    align-items: center;
    font-size: 1rem !important;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.push-notification-setting > label svg {
    color: var(--color-primary);
}

/* Container do toggle */
.push-notification-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: var(--spacing-sm) 0;
}

/* Toggle Switch Estilizado */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8b2fff 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Label do status */
.toggle-label {
    font-size: var(--font-size-base);
    color: var(--color-text);
    font-weight: 500;
}

/* Aviso de notificações bloqueadas */
.push-blocked-warning {
    display: block;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius-sm);
    color: #d63031;
    font-size: 0.8rem !important;
}

/* Feedback de ação */
.push-notification-feedback {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    animation: feedbackSlideIn 0.3s ease;
}

.push-notification-feedback.success {
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.3);
    color: #00b050;
}

.push-notification-feedback.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #d63031;
}

.push-notification-feedback.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

@keyframes feedbackSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsivo */
@media (max-width: 480px) {
    .push-notification-setting {
        padding: var(--spacing-md) !important;
    }

    .push-notification-toggle {
        flex-wrap: wrap;
    }
}
