/* Profile Section Styles */
.profile-section {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    padding: 24px;
    border: 1px solid #01455216;
    position: relative;
}

/* Success and Error Messages */
.profile-success-message,
.profile-error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.profile-success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.profile-error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.profile-success-message i,
.profile-error-message i {
    font-size: 16px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SSN Update Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    margin: 0;
    color: #014552;
    font-size: 18px;
    font-weight: 600;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 24px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #014552;
}

.form-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-field input:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.field-note {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 14px;
}

.consent-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    cursor: pointer;
}

.consent-label input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    width: auto;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e1e5e9;
}

.update-ssn-submit-btn,
.cancel-ssn-btn {
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.update-ssn-submit-btn {
    background-color: #ffc107;
    color: #000;
}

.update-ssn-submit-btn:hover {
    background-color: #e0a800;
}

.update-ssn-submit-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.cancel-ssn-btn {
    background-color: #6c757d;
    color: white;
}

.cancel-ssn-btn:hover {
    background-color: #5a6268;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.5rem;
    color: #1B3A5F;
    font-weight: 600;
}

.section-header h2 i {
    color: #1B3A5F;
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-field label {
    font-weight: 600;
    color: #1B3A5F;
    font-size: 0.875rem;
}

.field-value {
    padding: 12px;
    background: #eef2f9;
    border-radius: 6px;
    color: #1B3A5F;
    min-height: 48px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.field-note {
    color: #718096;
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Form Elements */
.profile-form input,
.profile-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    height: 48px;
    transition: all 0.2s;
}

.profile-form input:focus,
.profile-form select:focus {
    border-color: #1B3A5F;
    box-shadow: 0 0 0 3px rgba(27, 58, 95, 0.1);
    outline: none;
}

.profile-form input:disabled {
    background: #eef2f9;
    cursor: not-allowed;
    color: #718096;
    border-color: #e2e8f0;
}

/* Required Field Indicator */
.required {
    color: #c53030;
    margin-left: 2px;
}

/* Field Error States */
.profile-form input.invalid,
.profile-form select.invalid {
    border-color: #c53030;
}

.profile-form input.invalid:focus,
.profile-form select.invalid:focus {
    border-color: #c53030;
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.1);
}

.field-error {
    color: #c53030;
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 1em;
}

/* Buttons */
.edit-profile-btn,
.save-profile-btn,
.cancel-edit-btn,
.update-ssn-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.edit-profile-btn {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: white;
}

.edit-profile-btn:hover {
    background: linear-gradient(90deg, #FF7E1B, #FFAE00);
    transform: translateY(-1px);
}

.save-profile-btn {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: white;
}

.save-profile-btn:hover {
    background: linear-gradient(90deg, #FF7E1B, #FFAE00);
    transform: translateY(-1px);
}

.cancel-edit-btn {
    background: #eef2f9;
    color: #1B3A5F;
}

.cancel-edit-btn:hover {
    background: #e2e8f0;
}

.update-ssn-btn {
    background: #eef2f9;
    color: #1B3A5F;
    border: 1px solid #e2e8f0;
    margin-left: auto;
    padding: 8px 16px;
}

.update-ssn-btn:hover {
    background: #e2e8f0;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Sensitive Field */
.sensitive-field .field-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.sensitive-field .masked {
    font-family: monospace;
    letter-spacing: 1px;
    color: #1B3A5F;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    padding: 24px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #01455216;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #1B3A5F;
    font-weight: 600;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    padding: 4px;
}

.close-modal-btn:hover {
    color: #1B3A5F;
}

/* Consent Section */
.consent-section {
    margin: 20px 0;
    padding: 16px;
    background: #eef2f9;
    border-radius: 6px;
    border: 1px solid #01455216;
}

.consent-label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.875rem;
    color: #1B3A5F;
}

.consent-label input[type="checkbox"] {
    margin-top: 4px;
}

/* Success Message */
.success-message {
    background: #eef2f9;
    color: #1B3A5F;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #01455216;
}

/* Error Message */
.error-message {
    background: #fff5f5;
    color: #c53030;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #fc8181;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }

    .profile-section {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }
}

/* Header Actions - Button Group */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-actions .dashboard-button {
    white-space: nowrap;
    font-size: 14px;
    padding: 8px 16px;
}

/* Password Change Section Styles */
.password-change-section {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.password-change-section .section-header {
    margin-bottom: 24px;
}

.password-change-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.password-change-section h2 i {
    color: #6366f1;
}

/* Modern Password input wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding: 14px 50px 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1f2937;
}

.password-input-wrapper input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.password-input-wrapper input:valid {
    border-color: #10b981;
}

.password-input-wrapper input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.password-input-wrapper input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.password-input-wrapper input:hover:not(:focus) {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.password-toggle:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.password-toggle:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.password-toggle i {
    font-size: 16px;
    transition: color 0.2s ease;
    pointer-events: none;
}

/* Enhanced password toggle states */
.password-toggle.active {
    color: #6366f1;
    background-color: rgba(99, 102, 241, 0.1);
}

.password-toggle.active:hover {
    color: #4f46e5;
    background-color: rgba(99, 102, 241, 0.15);
}

/* Enhanced password field styling */
.password-change-section .profile-field {
    margin-bottom: 24px;
}

.password-change-section .profile-field label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.password-change-section .required {
    color: #ef4444;
    font-weight: 600;
}

.password-change-section .field-note {
    color: #6b7280;
    font-size: 13px;
    margin-top: 6px;
    display: block;
    font-style: italic;
}

.password-success-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 6px;
    margin-top: 16px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.password-success-message i {
    color: #28a745;
    font-size: 16px;
}

/* Responsive design for header actions */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .header-actions .dashboard-button {
        flex: 1;
        text-align: center;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .dashboard-button {
        width: 100%;
        max-width: none;
    }
}